Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-090 frontend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2021-090
2021-090 frontend
Commits
b3ab4668
Commit
b3ab4668
authored
Sep 23, 2021
by
IT18111170-Silva S.H.I
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update: login
parent
50f8c0e6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
10 deletions
+54
-10
Navigations/AuthStack.js
Navigations/AuthStack.js
+49
-1
screen/PriceScreen.js
screen/PriceScreen.js
+0
-3
screen/SignIn.js
screen/SignIn.js
+5
-6
No files found.
Navigations/AuthStack.js
View file @
b3ab4668
import
React
from
"
react
"
;
import
React
from
"
react
"
;
import
{
createStackNavigator
}
from
"
@react-navigation/stack
"
;
import
{
createStackNavigator
}
from
"
@react-navigation/stack
"
;
import
{
Ionicons
}
from
"
@expo/vector-icons
"
;
import
{
Ionicons
}
from
"
@expo/vector-icons
"
;
import
{
MaterialIcons
}
from
'
@expo/vector-icons
'
;
import
{
SignIn
}
from
"
../screen/SignIn
"
;
import
{
SignIn
}
from
"
../screen/SignIn
"
;
import
{
SignUp
}
from
"
../screen/SignUp
"
;
import
{
SignUp
}
from
"
../screen/SignUp
"
;
import
{
HomeScreen
}
from
"
../screen/HomeScreen
"
;
import
{
HomeScreen
}
from
"
../screen/HomeScreen
"
;
...
@@ -30,6 +30,14 @@ export function AuthStack({ navigation }) {
...
@@ -30,6 +30,14 @@ export function AuthStack({ navigation }) {
);
);
},
},
headerLeftContainerStyle
:
{
paddingLeft
:
10
},
headerLeftContainerStyle
:
{
paddingLeft
:
10
},
headerRight
:
()
=>
{
return
(
<
MaterialIcons
name
=
"
logout
"
size
=
{
30
}
color
=
"
black
"
/>
);
},
}}
}}
/
>
/
>
<
Stack
.
Screen
<
Stack
.
Screen
...
@@ -38,6 +46,14 @@ export function AuthStack({ navigation }) {
...
@@ -38,6 +46,14 @@ export function AuthStack({ navigation }) {
options
=
{{
options
=
{{
title
:
"
Sign Up Page
"
,
title
:
"
Sign Up Page
"
,
headerTitleAlign
:
"
center
"
,
headerTitleAlign
:
"
center
"
,
headerRight
:
()
=>
{
return
(
<
MaterialIcons
name
=
"
logout
"
size
=
{
30
}
color
=
"
black
"
/>
);
},
}}
}}
/
>
/
>
<
Stack
.
Screen
<
Stack
.
Screen
...
@@ -46,6 +62,14 @@ export function AuthStack({ navigation }) {
...
@@ -46,6 +62,14 @@ export function AuthStack({ navigation }) {
options
=
{{
options
=
{{
title
:
"
Agripreneurs
"
,
title
:
"
Agripreneurs
"
,
headerTitleAlign
:
"
center
"
,
headerTitleAlign
:
"
center
"
,
headerRight
:
()
=>
{
return
(
<
MaterialIcons
name
=
"
logout
"
size
=
{
30
}
color
=
"
black
"
/>
);
},
}}
}}
/
>
/
>
<
Stack
.
Screen
<
Stack
.
Screen
...
@@ -54,6 +78,14 @@ export function AuthStack({ navigation }) {
...
@@ -54,6 +78,14 @@ export function AuthStack({ navigation }) {
options
=
{{
options
=
{{
title
:
"
Leaderboard Page
"
,
title
:
"
Leaderboard Page
"
,
headerTitleAlign
:
"
center
"
,
headerTitleAlign
:
"
center
"
,
headerRight
:
()
=>
{
return
(
<
MaterialIcons
name
=
"
logout
"
size
=
{
30
}
color
=
"
black
"
/>
);
},
}}
}}
/
>
/
>
<
Stack
.
Screen
<
Stack
.
Screen
...
@@ -62,6 +94,14 @@ export function AuthStack({ navigation }) {
...
@@ -62,6 +94,14 @@ export function AuthStack({ navigation }) {
options
=
{{
options
=
{{
title
:
"
Discounted/Price Page
"
,
title
:
"
Discounted/Price Page
"
,
headerTitleAlign
:
"
center
"
,
headerTitleAlign
:
"
center
"
,
headerRight
:
()
=>
{
return
(
<
MaterialIcons
name
=
"
logout
"
size
=
{
30
}
color
=
"
black
"
/>
);
},
}}
}}
/
>
/
>
<
Stack
.
Screen
<
Stack
.
Screen
...
@@ -70,6 +110,14 @@ export function AuthStack({ navigation }) {
...
@@ -70,6 +110,14 @@ export function AuthStack({ navigation }) {
options
=
{{
options
=
{{
title
:
"
Gamification Page
"
,
title
:
"
Gamification Page
"
,
headerTitleAlign
:
"
center
"
,
headerTitleAlign
:
"
center
"
,
headerRight
:
()
=>
{
return
(
<
MaterialIcons
name
=
"
logout
"
size
=
{
30
}
color
=
"
black
"
/>
);
},
}}
}}
/
>
/
>
<
Stack
.
Screen
<
Stack
.
Screen
...
...
screen/PriceScreen.js
View file @
b3ab4668
...
@@ -92,9 +92,6 @@ export function PriceScreen({ navigation, data }) {
...
@@ -92,9 +92,6 @@ export function PriceScreen({ navigation, data }) {
<
TouchableOpacity
>
<
TouchableOpacity
>
<
FontAwesome5
name
=
"
user-edit
"
size
=
{
30
}
color
=
"
black
"
/>
<
FontAwesome5
name
=
"
user-edit
"
size
=
{
30
}
color
=
"
black
"
/>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
TouchableOpacity
>
<
AntDesign
name
=
"
logout
"
size
=
{
30
}
color
=
"
black
"
/>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
View
style
=
{
styles
.
secondContainer
}
>
<
View
style
=
{
styles
.
secondContainer
}
>
<
View
style
=
{
styles
.
SectionStyle
}
>
<
View
style
=
{
styles
.
SectionStyle
}
>
...
...
screen/SignIn.js
View file @
b3ab4668
...
@@ -23,7 +23,7 @@ export function SignIn({ navigation }) {
...
@@ -23,7 +23,7 @@ export function SignIn({ navigation }) {
});
});
const
textInputChange
=
(
val
)
=>
{
const
textInputChange
=
(
val
)
=>
{
if
(
val
.
trim
().
length
>=
4
)
{
if
(
val
.
trim
().
length
>=
4
&&
val
.
includes
(
'
@
'
)
)
{
setData
({
setData
({
...
data
,
...
data
,
email
:
val
,
email
:
val
,
...
@@ -41,7 +41,7 @@ export function SignIn({ navigation }) {
...
@@ -41,7 +41,7 @@ export function SignIn({ navigation }) {
};
};
const
handlePasswordChange
=
(
val
)
=>
{
const
handlePasswordChange
=
(
val
)
=>
{
if
(
val
.
trim
().
length
>=
3
)
{
if
(
val
.
trim
().
length
>=
4
)
{
setData
({
setData
({
...
data
,
...
data
,
password
:
val
,
password
:
val
,
...
@@ -93,7 +93,7 @@ export function SignIn({ navigation }) {
...
@@ -93,7 +93,7 @@ export function SignIn({ navigation }) {
<
/View
>
<
/View
>
{
data
.
isValidUser
?
null
:
(
{
data
.
isValidUser
?
null
:
(
<
Text
style
=
{
styles
.
errorMsg
}
>
<
Text
style
=
{
styles
.
errorMsg
}
>
Email
must
be
4
characters
long
Email
must
be
4
characters
long
and
iclude
@
<
/Text
>
<
/Text
>
)}
)}
<
/View
>
<
/View
>
...
@@ -114,7 +114,7 @@ export function SignIn({ navigation }) {
...
@@ -114,7 +114,7 @@ export function SignIn({ navigation }) {
<
/View
>
<
/View
>
{
data
.
isValidPassword
?
null
:
(
{
data
.
isValidPassword
?
null
:
(
<
Text
style
=
{
styles
.
errorMsg
}
>
<
Text
style
=
{
styles
.
errorMsg
}
>
Password
must
be
6
characters
long
.
Password
must
be
minimum
4
characters
long
.
<
/Text
>
<
/Text
>
)}
)}
<
/View
>
<
/View
>
...
@@ -123,8 +123,6 @@ export function SignIn({ navigation }) {
...
@@ -123,8 +123,6 @@ export function SignIn({ navigation }) {
style
=
{
styles
.
buttonSub
}
style
=
{
styles
.
buttonSub
}
activeOpacity
=
{
0.5
}
activeOpacity
=
{
0.5
}
onPress
=
{()
=>
onPress
=
{()
=>
axios
.
post
(
"
http://192.168.8.126:5000/login
"
,
form
)
axios
.
post
(
"
http://192.168.8.126:5000/login
"
,
form
)
.
then
(
function
(
response
)
{
.
then
(
function
(
response
)
{
const
stngobj
=
JSON
.
stringify
(
response
.
data
)
const
stngobj
=
JSON
.
stringify
(
response
.
data
)
...
@@ -135,6 +133,7 @@ export function SignIn({ navigation }) {
...
@@ -135,6 +133,7 @@ export function SignIn({ navigation }) {
})
})
.
catch
(
function
(
error
)
{
.
catch
(
function
(
error
)
{
console
.
log
(
error
);
console
.
log
(
error
);
alert
(
"
Login failed
"
)
})
})
}
}
>
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment