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
0a075d5b
Commit
0a075d5b
authored
Sep 22, 2021
by
IT18111170-Silva S.H.I
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Udate: form validation success
parent
496dc27f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
573 additions
and
227 deletions
+573
-227
App.js
App.js
+2
-0
package-lock.json
package-lock.json
+156
-0
package.json
package.json
+5
-1
screen/HomeScreen.js
screen/HomeScreen.js
+1
-0
screen/Leaderboard.js
screen/Leaderboard.js
+1
-0
screen/PriceScreen.js
screen/PriceScreen.js
+94
-52
screen/SignIn.js
screen/SignIn.js
+228
-154
screen/SignUp.js
screen/SignUp.js
+86
-20
No files found.
App.js
View file @
0a075d5b
...
@@ -7,6 +7,7 @@ import { homeStack } from "./Navigations/homeStack";
...
@@ -7,6 +7,7 @@ import { homeStack } from "./Navigations/homeStack";
import
{
AuthStack
}
from
"
./Navigations/AuthStack
"
;
import
{
AuthStack
}
from
"
./Navigations/AuthStack
"
;
import
{
FontAwesome
}
from
'
@expo/vector-icons
'
;
import
{
FontAwesome
}
from
'
@expo/vector-icons
'
;
import
{
AboutUs
}
from
'
./screen/AboutUs
'
;
import
{
AboutUs
}
from
'
./screen/AboutUs
'
;
// import MainTabScreen from './screen/MainTabScreen';
const
Drawer
=
createDrawerNavigator
();
const
Drawer
=
createDrawerNavigator
();
...
@@ -19,6 +20,7 @@ export default function App() {
...
@@ -19,6 +20,7 @@ export default function App() {
<
Drawer
.
Navigator
initialRouteName
=
"
Authntications
"
>
<
Drawer
.
Navigator
initialRouteName
=
"
Authntications
"
>
<
Drawer
.
Screen
name
=
"
Authentications
"
component
=
{
AuthStack
}
/
>
<
Drawer
.
Screen
name
=
"
Authentications
"
component
=
{
AuthStack
}
/
>
<
Drawer
.
Screen
name
=
"
Agripreneurs
"
component
=
{
homeStack
}
/
>
<
Drawer
.
Screen
name
=
"
Agripreneurs
"
component
=
{
homeStack
}
/
>
{
/* <Drawer.Screen name="MainTab" component={MainTabScreen} /> */
}
<
Drawer
.
Screen
name
=
"
About Us
"
component
=
{
AboutUs
}
/
>
<
Drawer
.
Screen
name
=
"
About Us
"
component
=
{
AboutUs
}
/
>
<
/Drawer.Navigator
>
<
/Drawer.Navigator
>
<
/NavigationContainer
>
<
/NavigationContainer
>
...
...
package-lock.json
View file @
0a075d5b
...
@@ -1120,6 +1120,15 @@
...
@@ -1120,6 +1120,15 @@
"to-fast-properties"
:
"^2.0.0"
"to-fast-properties"
:
"^2.0.0"
}
}
},
},
"@callstack/react-theme-provider"
:
{
"version"
:
"3.0.6"
,
"resolved"
:
"https://registry.npmjs.org/@callstack/react-theme-provider/-/react-theme-provider-3.0.6.tgz"
,
"integrity"
:
"sha512-wwKMXfmklfogpalNZT0W+jh76BIquiYUiQHOaPmt/PCyCEP/E6rP+e7Uie6mBZrfkea9WJYJ+mus6r+45JAEhg=="
,
"requires"
:
{
"deepmerge"
:
"^3.2.0"
,
"hoist-non-react-statics"
:
"^3.3.0"
}
},
"@cnakazawa/watch"
:
{
"@cnakazawa/watch"
:
{
"version"
:
"1.0.4"
,
"version"
:
"1.0.4"
,
"resolved"
:
"https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz"
,
"resolved"
:
"https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz"
,
...
@@ -2203,6 +2212,19 @@
...
@@ -2203,6 +2212,19 @@
"react-native-iphone-x-helper"
:
"^1.3.0"
"react-native-iphone-x-helper"
:
"^1.3.0"
}
}
},
},
"@react-navigation/elements"
:
{
"version"
:
"1.1.0"
,
"resolved"
:
"https://registry.npmjs.org/@react-navigation/elements/-/elements-1.1.0.tgz"
,
"integrity"
:
"sha512-jZncciZPGuoP6B6f+Wpf6MYSSYy86B2HJDbFTCtT5xZV0w6V9GgCeqvSTOEAxifZrmKl8uDxsr0GrIxgQE8NxA=="
},
"@react-navigation/material-bottom-tabs"
:
{
"version"
:
"6.0.5"
,
"resolved"
:
"https://registry.npmjs.org/@react-navigation/material-bottom-tabs/-/material-bottom-tabs-6.0.5.tgz"
,
"integrity"
:
"sha512-u1vEH4Sxs3vofaS08jNcY9305OAsRQQPVZMfa2dsBTAaxEhH/nDotATmKngZoXiMm269bc/8LUUkHKL5/v9xvQ=="
,
"requires"
:
{
"@react-navigation/elements"
:
"^1.1.0"
}
},
"@react-navigation/native"
:
{
"@react-navigation/native"
:
{
"version"
:
"5.9.4"
,
"version"
:
"5.9.4"
,
"resolved"
:
"https://registry.npmjs.org/@react-navigation/native/-/native-5.9.4.tgz"
,
"resolved"
:
"https://registry.npmjs.org/@react-navigation/native/-/native-5.9.4.tgz"
,
...
@@ -2280,6 +2302,11 @@
...
@@ -2280,6 +2302,11 @@
"@types/istanbul-lib-report"
:
"*"
"@types/istanbul-lib-report"
:
"*"
}
}
},
},
"@types/lodash"
:
{
"version"
:
"4.14.173"
,
"resolved"
:
"https://registry.npmjs.org/@types/lodash/-/lodash-4.14.173.tgz"
,
"integrity"
:
"sha512-vv0CAYoaEjCw/mLy96GBTnRoZrSxkGE0BKzKimdR8P3OzrNYNvBgtW7p055A+E8C31vXNUhWKoFCbhq7gbyhFg=="
},
"@types/node"
:
{
"@types/node"
:
{
"version"
:
"15.12.2"
,
"version"
:
"15.12.2"
,
"resolved"
:
"https://registry.npmjs.org/@types/node/-/node-15.12.2.tgz"
,
"resolved"
:
"https://registry.npmjs.org/@types/node/-/node-15.12.2.tgz"
,
...
@@ -6142,6 +6169,11 @@
...
@@ -6142,6 +6169,11 @@
"integrity"
:
"sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ=="
,
"integrity"
:
"sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ=="
,
"optional"
:
true
"optional"
:
true
},
},
"nanoclone"
:
{
"version"
:
"0.2.1"
,
"resolved"
:
"https://registry.npmjs.org/nanoclone/-/nanoclone-0.2.1.tgz"
,
"integrity"
:
"sha512-wynEP02LmIbLpcYw8uBKpcfF6dmg2vcpKqxeH5UcoKEYdExslsdUA4ugFauuaeYdTB76ez6gJW8XAZ6CgkXYxA=="
},
"nanoid"
:
{
"nanoid"
:
{
"version"
:
"3.1.23"
,
"version"
:
"3.1.23"
,
"resolved"
:
"https://registry.npmjs.org/nanoid/-/nanoid-3.1.23.tgz"
,
"resolved"
:
"https://registry.npmjs.org/nanoid/-/nanoid-3.1.23.tgz"
,
...
@@ -6797,6 +6829,11 @@
...
@@ -6797,6 +6829,11 @@
}
}
}
}
},
},
"property-expr"
:
{
"version"
:
"2.0.4"
,
"resolved"
:
"https://registry.npmjs.org/property-expr/-/property-expr-2.0.4.tgz"
,
"integrity"
:
"sha512-sFPkHQjVKheDNnPvotjQmm3KD3uk1fWKUN7CrpdbwmUx3CrG3QiM8QpTSimvig5vTXmTvjz7+TDvXOI9+4rkcg=="
},
"pseudomap"
:
{
"pseudomap"
:
{
"version"
:
"1.0.2"
,
"version"
:
"1.0.2"
,
"resolved"
:
"https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz"
,
"resolved"
:
"https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz"
,
...
@@ -7244,6 +7281,16 @@
...
@@ -7244,6 +7281,16 @@
"resolved"
:
"https://registry.npmjs.org/react-native-iphone-x-helper/-/react-native-iphone-x-helper-1.3.1.tgz"
,
"resolved"
:
"https://registry.npmjs.org/react-native-iphone-x-helper/-/react-native-iphone-x-helper-1.3.1.tgz"
,
"integrity"
:
"sha512-HOf0jzRnq2/aFUcdCJ9w9JGzN3gdEg0zFE4FyYlp4jtidqU03D5X7ZegGKfT1EWteR0gPBGp9ye5T5FvSWi9Yg=="
"integrity"
:
"sha512-HOf0jzRnq2/aFUcdCJ9w9JGzN3gdEg0zFE4FyYlp4jtidqU03D5X7ZegGKfT1EWteR0gPBGp9ye5T5FvSWi9Yg=="
},
},
"react-native-paper"
:
{
"version"
:
"4.9.2"
,
"resolved"
:
"https://registry.npmjs.org/react-native-paper/-/react-native-paper-4.9.2.tgz"
,
"integrity"
:
"sha512-J7FRsd0YblQawtuj9I46F//apZHadsCKk6jWpc6njFTYdgUeCdkR8KgEto7cp2WxbcGNELx7KGwPQ4zAgX746A=="
,
"requires"
:
{
"@callstack/react-theme-provider"
:
"^3.0.6"
,
"color"
:
"^3.1.2"
,
"react-native-iphone-x-helper"
:
"^1.3.1"
}
},
"react-native-reanimated"
:
{
"react-native-reanimated"
:
{
"version"
:
"2.1.0"
,
"version"
:
"2.1.0"
,
"resolved"
:
"https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-2.1.0.tgz"
,
"resolved"
:
"https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-2.1.0.tgz"
,
...
@@ -7296,6 +7343,96 @@
...
@@ -7296,6 +7343,96 @@
"resolved"
:
"https://registry.npmjs.org/react-native-screens/-/react-native-screens-3.0.0.tgz"
,
"resolved"
:
"https://registry.npmjs.org/react-native-screens/-/react-native-screens-3.0.0.tgz"
,
"integrity"
:
"sha512-35II5oxTaVp3OP8y0eLPOPpQkxG4fRKQ+dL1YSE1we5kCZFOU0l/Rn0T79HbyUu1LPwUZr6lZupPs0ULnRyMuQ=="
"integrity"
:
"sha512-35II5oxTaVp3OP8y0eLPOPpQkxG4fRKQ+dL1YSE1we5kCZFOU0l/Rn0T79HbyUu1LPwUZr6lZupPs0ULnRyMuQ=="
},
},
"react-native-vector-icons"
:
{
"version"
:
"8.1.0"
,
"resolved"
:
"https://registry.npmjs.org/react-native-vector-icons/-/react-native-vector-icons-8.1.0.tgz"
,
"integrity"
:
"sha512-sHIdBB6Y0dHaot2fMXgy5J/hhCn5YuyN7SKDNFgPzL8KA1oF2/v7mgYMavnK7LIIs2dJoGnDANKf61dsU+TZlg=="
,
"requires"
:
{
"lodash.frompairs"
:
"^4.0.1"
,
"lodash.isequal"
:
"^4.5.0"
,
"lodash.isstring"
:
"^4.0.1"
,
"lodash.omit"
:
"^4.5.0"
,
"lodash.pick"
:
"^4.4.0"
,
"lodash.template"
:
"^4.5.0"
,
"prop-types"
:
"^15.7.2"
,
"yargs"
:
"^16.1.1"
},
"dependencies"
:
{
"ansi-styles"
:
{
"version"
:
"4.3.0"
,
"resolved"
:
"https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz"
,
"integrity"
:
"sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="
,
"requires"
:
{
"color-convert"
:
"^2.0.1"
}
},
"cliui"
:
{
"version"
:
"7.0.4"
,
"resolved"
:
"https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz"
,
"integrity"
:
"sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ=="
,
"requires"
:
{
"string-width"
:
"^4.2.0"
,
"strip-ansi"
:
"^6.0.0"
,
"wrap-ansi"
:
"^7.0.0"
}
},
"color-convert"
:
{
"version"
:
"2.0.1"
,
"resolved"
:
"https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz"
,
"integrity"
:
"sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="
,
"requires"
:
{
"color-name"
:
"~1.1.4"
}
},
"color-name"
:
{
"version"
:
"1.1.4"
,
"resolved"
:
"https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz"
,
"integrity"
:
"sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"strip-ansi"
:
{
"version"
:
"6.0.0"
,
"resolved"
:
"https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz"
,
"integrity"
:
"sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w=="
,
"requires"
:
{
"ansi-regex"
:
"^5.0.0"
}
},
"wrap-ansi"
:
{
"version"
:
"7.0.0"
,
"resolved"
:
"https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz"
,
"integrity"
:
"sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q=="
,
"requires"
:
{
"ansi-styles"
:
"^4.0.0"
,
"string-width"
:
"^4.1.0"
,
"strip-ansi"
:
"^6.0.0"
}
},
"y18n"
:
{
"version"
:
"5.0.8"
,
"resolved"
:
"https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz"
,
"integrity"
:
"sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA=="
},
"yargs"
:
{
"version"
:
"16.2.0"
,
"resolved"
:
"https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz"
,
"integrity"
:
"sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw=="
,
"requires"
:
{
"cliui"
:
"^7.0.2"
,
"escalade"
:
"^3.1.1"
,
"get-caller-file"
:
"^2.0.5"
,
"require-directory"
:
"^2.1.1"
,
"string-width"
:
"^4.2.0"
,
"y18n"
:
"^5.0.5"
,
"yargs-parser"
:
"^20.2.2"
}
},
"yargs-parser"
:
{
"version"
:
"20.2.9"
,
"resolved"
:
"https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz"
,
"integrity"
:
"sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w=="
}
}
},
"react-native-web"
:
{
"react-native-web"
:
{
"version"
:
"0.13.18"
,
"version"
:
"0.13.18"
,
"resolved"
:
"https://registry.npmjs.org/react-native-web/-/react-native-web-0.13.18.tgz"
,
"resolved"
:
"https://registry.npmjs.org/react-native-web/-/react-native-web-0.13.18.tgz"
,
...
@@ -8256,6 +8393,11 @@
...
@@ -8256,6 +8393,11 @@
"resolved"
:
"https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz"
,
"resolved"
:
"https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz"
,
"integrity"
:
"sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw=="
"integrity"
:
"sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw=="
},
},
"toposort"
:
{
"version"
:
"2.0.2"
,
"resolved"
:
"https://registry.npmjs.org/toposort/-/toposort-2.0.2.tgz"
,
"integrity"
:
"sha1-riF2gXXRVZ1IvvNUILL0li8JwzA="
},
"tslib"
:
{
"tslib"
:
{
"version"
:
"1.14.1"
,
"version"
:
"1.14.1"
,
"resolved"
:
"https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz"
,
"resolved"
:
"https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz"
,
...
@@ -8768,6 +8910,20 @@
...
@@ -8768,6 +8910,20 @@
"version"
:
"0.1.0"
,
"version"
:
"0.1.0"
,
"resolved"
:
"https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz"
,
"resolved"
:
"https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz"
,
"integrity"
:
"sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="
"integrity"
:
"sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="
},
"yup"
:
{
"version"
:
"0.32.9"
,
"resolved"
:
"https://registry.npmjs.org/yup/-/yup-0.32.9.tgz"
,
"integrity"
:
"sha512-Ci1qN+i2H0XpY7syDQ0k5zKQ/DoxO0LzPg8PAR/X4Mpj6DqaeCoIYEEjDJwhArh3Fa7GWbQQVDZKeXYlSH4JMg=="
,
"requires"
:
{
"@babel/runtime"
:
"^7.10.5"
,
"@types/lodash"
:
"^4.14.165"
,
"lodash"
:
"^4.17.20"
,
"lodash-es"
:
"^4.17.15"
,
"nanoclone"
:
"^0.2.1"
,
"property-expr"
:
"^2.0.4"
,
"toposort"
:
"^2.0.2"
}
}
}
}
}
}
}
package.json
View file @
0a075d5b
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
"
@react-native-community/async-storage
"
:
"
^1.12.1
"
,
"
@react-native-community/async-storage
"
:
"
^1.12.1
"
,
"
@react-native-community/masked-view
"
:
"
0.1.10
"
,
"
@react-native-community/masked-view
"
:
"
0.1.10
"
,
"
@react-navigation/drawer
"
:
"
^5.12.5
"
,
"
@react-navigation/drawer
"
:
"
^5.12.5
"
,
"
@react-navigation/material-bottom-tabs
"
:
"
^6.0.5
"
,
"
@react-navigation/native
"
:
"
^5.9.4
"
,
"
@react-navigation/native
"
:
"
^5.9.4
"
,
"
@react-navigation/stack
"
:
"
^5.14.5
"
,
"
@react-navigation/stack
"
:
"
^5.14.5
"
,
"
axios
"
:
"
^0.21.4
"
,
"
axios
"
:
"
^0.21.4
"
,
...
@@ -23,12 +24,15 @@
...
@@ -23,12 +24,15 @@
"
react-native
"
:
"
https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz
"
,
"
react-native
"
:
"
https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz
"
,
"
react-native-gesture-handler
"
:
"
^1.10.3
"
,
"
react-native-gesture-handler
"
:
"
^1.10.3
"
,
"
react-native-image-slideshow
"
:
"
^1.0.1
"
,
"
react-native-image-slideshow
"
:
"
^1.0.1
"
,
"
react-native-paper
"
:
"
^4.9.2
"
,
"
react-native-reanimated
"
:
"
~2.1.0
"
,
"
react-native-reanimated
"
:
"
~2.1.0
"
,
"
react-native-safe-area-context
"
:
"
3.2.0
"
,
"
react-native-safe-area-context
"
:
"
3.2.0
"
,
"
react-native-screens
"
:
"
~3.0.0
"
,
"
react-native-screens
"
:
"
~3.0.0
"
,
"
react-native-vector-icons
"
:
"
^8.1.0
"
,
"
react-native-web
"
:
"
~0.13.12
"
,
"
react-native-web
"
:
"
~0.13.12
"
,
"
react-navigation
"
:
"
^4.4.4
"
,
"
react-navigation
"
:
"
^4.4.4
"
,
"
react-navigation-drawer
"
:
"
^2.7.1
"
"
react-navigation-drawer
"
:
"
^2.7.1
"
,
"
yup
"
:
"
^0.32.9
"
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"
@babel/core
"
:
"
^7.9.0
"
"
@babel/core
"
:
"
^7.9.0
"
...
...
screen/HomeScreen.js
View file @
0a075d5b
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
// Import React and Component
// Import React and Component
import
React
from
'
react
'
;
import
React
from
'
react
'
;
// import { StatusBar } from 'expo-status-bar';
import
{
StyleSheet
,
View
,
Text
,
TouchableOpacity
,
ImageBackground
}
from
"
react-native
"
;
import
{
StyleSheet
,
View
,
Text
,
TouchableOpacity
,
ImageBackground
}
from
"
react-native
"
;
import
ImageSliderz
from
"
react-native-image-slideshow
"
;
import
ImageSliderz
from
"
react-native-image-slideshow
"
;
import
{
import
{
...
...
screen/Leaderboard.js
View file @
0a075d5b
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
{
StyleSheet
,
Button
,
TextInput
,
View
,
Text
,
TouchableOpacity
,
ImageBackground
}
from
'
react-native
'
;
import
{
StyleSheet
,
Button
,
TextInput
,
View
,
Text
,
TouchableOpacity
,
ImageBackground
}
from
'
react-native
'
;
import
axios
from
'
axios
'
import
{
ScrollView
}
from
"
react-native-gesture-handler
"
;
import
{
ScrollView
}
from
"
react-native-gesture-handler
"
;
import
{
FontAwesome
}
from
"
@expo/vector-icons
"
;
import
{
FontAwesome
}
from
"
@expo/vector-icons
"
;
...
...
screen/PriceScreen.js
View file @
0a075d5b
...
@@ -12,55 +12,79 @@ import { FontAwesome } from "@expo/vector-icons";
...
@@ -12,55 +12,79 @@ import { FontAwesome } from "@expo/vector-icons";
import
{
FontAwesome5
}
from
"
@expo/vector-icons
"
;
import
{
FontAwesome5
}
from
"
@expo/vector-icons
"
;
import
{
Entypo
}
from
"
@expo/vector-icons
"
;
import
{
Entypo
}
from
"
@expo/vector-icons
"
;
import
{
Ionicons
}
from
"
@expo/vector-icons
"
;
import
{
Ionicons
}
from
"
@expo/vector-icons
"
;
import
{
AntDesign
}
from
'
@expo/vector-icons
'
;
export
function
PriceScreen
({
navigation
,
data
})
{
export
function
PriceScreen
({
navigation
,
data
})
{
return
(
<
View
style
=
{
styles
.
container
}
>
{
/* <ImageBackground source={require('../assets/agri.jpg')} style={styles.images}>
const
[
details
,
setDetails
]
=
useState
({
email
:
""
,
earns
:
""
,
district
:
""
,
isValidUser
:
true
,
isValidearns
:
true
,
isValiddistrict
:
true
,
check_textinputChange
:
false
});
<View style={styles.inContainer}>
<View ><Text style={styles.heading}>User Profile</Text></View>
<View style={styles.iconStyle}>
<FontAwesome
name="user-circle"
size={70}
color="black"
/>
</View>
<View>
<TextInput
style={styles.input}
multiline
placeholder='Name'
/>
<TextInput
style={styles.input}
multiline
placeholder='Earns'
/>
<TextInput
style={styles.input}
multiline
placeholder='District'
// onChangeText={props.handleChange('password')}
// value={navigation.getParams('District')}
/>
<TouchableOpacity style = {styles.buttonSub} title="Sign Up" >
<Text style={styles.buttonText}>Save Details</Text>
</TouchableOpacity>
<Text style={styles.texts}>You Have earned 5% Discount</Text>
const
textInputChange
=
(
val
)
=>
{
</View>
if
(
val
.
trim
().
length
>=
4
)
{
</View>
setDetails
({
</ImageBackground> */
}
...
details
,
email
:
val
,
check_textInputChange
:
true
,
isValidUser
:
true
});
}
else
{
setDetails
({
...
details
,
email
:
val
,
check_textInputChange
:
false
,
isValidUser
:
false
});
}
}
const
handleEarnsChanged
=
(
val
)
=>
{
if
(
val
.
trim
().
length
<=
7
)
{
setDetails
({
...
details
,
earns
:
val
,
isValidearns
:
true
});
}
else
{
setDetails
({
...
details
,
earns
:
val
,
isValidearns
:
false
});
}
}
const
handleDistrictChanged
=
(
val
)
=>
{
if
(
val
.
trim
().
length
>=
4
)
{
setDetails
({
...
details
,
district
:
val
,
isValiddistrict
:
true
});
}
else
{
setDetails
({
...
details
,
district
:
val
,
isValiddistrict
:
false
});
}
}
<
ImageBackground
return
(
<
View
style
=
{
styles
.
container
}
>
<
ImageBackground
source
=
{
require
(
"
../assets/signin1.jpg
"
)}
source
=
{
require
(
"
../assets/signin1.jpg
"
)}
style
=
{
styles
.
images
}
style
=
{
styles
.
images
}
>
>
...
@@ -68,6 +92,9 @@ export function PriceScreen({ navigation, data }) {
...
@@ -68,6 +92,9 @@ 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
}
>
...
@@ -93,12 +120,12 @@ export function PriceScreen({ navigation, data }) {
...
@@ -93,12 +120,12 @@ export function PriceScreen({ navigation, data }) {
<
Entypo
name
=
"
user
"
size
=
{
30
}
color
=
"
white
"
/>
<
Entypo
name
=
"
user
"
size
=
{
30
}
color
=
"
white
"
/>
<
TextInput
<
TextInput
style
=
{
styles
.
input1
}
style
=
{
styles
.
input1
}
// onChangeText={(UserEmai
l) =>
onChangeText
=
{(
va
l
)
=>
// setUserEmail(UserEmai
l)
textInputChange
(
va
l
)
//
}
}
placeholder
=
"
Enter Email
"
//dummy@abc.com
placeholder
=
"
Enter Email
"
//dummy@abc.com
placeholderTextColor
=
"
#8b9cb5
"
placeholderTextColor
=
"
#8b9cb5
"
//
keyboardType="email-address"
keyboardType
=
"
email-address
"
// onSubmitEditing={() =>
// onSubmitEditing={() =>
// passwordInputRef.current &&
// passwordInputRef.current &&
// passwordInputRef.current.focus()
// passwordInputRef.current.focus()
...
@@ -106,6 +133,9 @@ export function PriceScreen({ navigation, data }) {
...
@@ -106,6 +133,9 @@ export function PriceScreen({ navigation, data }) {
blurOnSubmit
=
{
false
}
blurOnSubmit
=
{
false
}
/
>
/
>
<
/View
>
<
/View
>
{
details
.
isValidUser
?
null
:
<
Text
style
=
{
styles
.
errorMsg
}
>
Email
must
be
4
characters
long
<
/Text
>
}
<
/View
>
<
/View
>
<
View
style
=
{
styles
.
SectionStyle
}
>
<
View
style
=
{
styles
.
SectionStyle
}
>
...
@@ -113,9 +143,9 @@ export function PriceScreen({ navigation, data }) {
...
@@ -113,9 +143,9 @@ export function PriceScreen({ navigation, data }) {
<
FontAwesome
name
=
"
money
"
size
=
{
30
}
color
=
"
white
"
/>
<
FontAwesome
name
=
"
money
"
size
=
{
30
}
color
=
"
white
"
/>
<
TextInput
<
TextInput
style
=
{
styles
.
input1
}
style
=
{
styles
.
input1
}
// onChangeText={(UserPassword
) =>
onChangeText
=
{(
val
)
=>
// setUserPassword(UserPassword
)
handleEarnsChanged
(
val
)
//
}
}
placeholder
=
"
Enter Earns
"
//12345
placeholder
=
"
Enter Earns
"
//12345
placeholderTextColor
=
"
#8b9cb5
"
placeholderTextColor
=
"
#8b9cb5
"
// ref={passwordInputRef}
// ref={passwordInputRef}
...
@@ -124,15 +154,18 @@ export function PriceScreen({ navigation, data }) {
...
@@ -124,15 +154,18 @@ export function PriceScreen({ navigation, data }) {
secureTextEntry
=
{
true
}
secureTextEntry
=
{
true
}
/
>
/
>
<
/View
>
<
/View
>
{
details
.
isValidearns
?
null
:
<
Text
style
=
{
styles
.
errorMsg
}
>
Email
must
be
4
characters
long
<
/Text
>
}
<
/View
>
<
/View
>
<
View
style
=
{
styles
.
SectionStyle
}
>
<
View
style
=
{
styles
.
SectionStyle
}
>
<
View
style
=
{
styles
.
textinputicon
}
>
<
View
style
=
{
styles
.
textinputicon
}
>
<
Entypo
name
=
"
location-pin
"
size
=
{
30
}
color
=
"
white
"
/>
<
Entypo
name
=
"
location-pin
"
size
=
{
30
}
color
=
"
white
"
/>
<
TextInput
<
TextInput
style
=
{
styles
.
input1
}
style
=
{
styles
.
input1
}
// onChangeText={(UserPassword
) =>
onChangeText
=
{(
val
)
=>
// setUserPassword(UserPassword
)
handleDistrictChanged
(
val
)
//
}
}
placeholder
=
"
Enter District
"
//12345
placeholder
=
"
Enter District
"
//12345
placeholderTextColor
=
"
#8b9cb5
"
placeholderTextColor
=
"
#8b9cb5
"
// ref={passwordInputRef}
// ref={passwordInputRef}
...
@@ -141,6 +174,9 @@ export function PriceScreen({ navigation, data }) {
...
@@ -141,6 +174,9 @@ export function PriceScreen({ navigation, data }) {
secureTextEntry
=
{
true
}
secureTextEntry
=
{
true
}
/
>
/
>
<
/View
>
<
/View
>
{
details
.
isValiddistrict
?
null
:
<
Text
style
=
{
styles
.
errorMsg
}
>
Email
must
be
4
characters
long
<
/Text
>
}
<
/View
>
<
/View
>
<
View
style
=
{
styles
.
buttons
}
>
<
View
style
=
{
styles
.
buttons
}
>
<
TouchableOpacity
<
TouchableOpacity
...
@@ -256,5 +292,11 @@ const styles = StyleSheet.create({
...
@@ -256,5 +292,11 @@ const styles = StyleSheet.create({
},
},
editUSer
:
{
editUSer
:
{
alignSelf
:
"
flex-end
"
,
alignSelf
:
"
flex-end
"
,
flexDirection
:
"
row
"
,
},
},
errorMsg
:{
color
:
'
black
'
,
fontSize
:
14
,
alignSelf
:
"
center
"
}
});
});
screen/SignIn.js
View file @
0a075d5b
import
React
from
'
react
'
;
import
React
,
{
useState
,
useEffect
}
from
"
react
"
;
import
{
StyleSheet
,
Button
,
TextInput
,
View
,
Text
,
TouchableOpacity
,
ImageBackground
}
from
'
react-native
'
;
import
{
import
{
Entypo
}
from
'
@expo/vector-icons
'
;
StyleSheet
,
Button
,
TextInput
,
View
,
Text
,
TouchableOpacity
,
ImageBackground
,
}
from
"
react-native
"
;
import
{
Entypo
}
from
"
@expo/vector-icons
"
;
import
axios
from
"
axios
"
;
export
function
SignIn
({
navigation
})
{
export
function
SignIn
({
navigation
})
{
return
(
<
View
style
=
{
styles
.
container
}
>
<
ImageBackground
source
=
{
require
(
'
../assets/signin1.jpg
'
)}
style
=
{
styles
.
images
}
>
<
View
style
=
{
styles
.
secondContainer
}
>
<
View
style
=
{
styles
.
SectionStyle
}
>
<
Text
style
=
{
styles
.
text
}
>
HELLO
<
/Text
>
<
Text
style
=
{
styles
.
text1
}
>
Sign
In
to
your
Account
<
/Text
>
<
View
style
=
{
styles
.
textinputicon
}
>
const
[
data
,
setData
]
=
useState
({
<
Entypo
name
=
"
user
"
size
=
{
30
}
color
=
"
white
"
/>
email
:
""
,
<
TextInput
password
:
""
,
style
=
{
styles
.
input1
}
isValidUser
:
true
,
// onChangeText={(UserEmail) =>
isValidPassword
:
true
,
// setUserEmail(UserEmail)
check_textinputChange
:
false
// }
});
placeholder
=
"
Enter Email
"
//dummy@abc.com
placeholderTextColor
=
"
#8b9cb5
"
// keyboardType="email-address"
// onSubmitEditing={() =>
const
textInputChange
=
(
val
)
=>
{
// passwordInputRef.current &&
if
(
val
.
trim
().
length
>=
4
)
{
// passwordInputRef.current.focus()
setData
({
// }
...
data
,
blurOnSubmit
=
{
false
}
username
:
val
,
/
>
check_textInputChange
:
true
,
<
/View
>
isValidUser
:
true
});
}
else
{
setData
({
...
data
,
username
:
val
,
check_textInputChange
:
false
,
isValidUser
:
false
});
}
}
const
handlePasswordChange
=
(
val
)
=>
{
if
(
val
.
trim
().
length
>=
6
)
{
setData
({
...
data
,
password
:
val
,
isValidPassword
:
true
});
}
else
{
setData
({
...
data
,
password
:
val
,
isValidPassword
:
false
});
}
}
return
(
<
View
style
=
{
styles
.
container
}
>
<
ImageBackground
source
=
{
require
(
"
../assets/signin1.jpg
"
)}
style
=
{
styles
.
images
}
>
<
View
style
=
{
styles
.
secondContainer
}
>
<
View
style
=
{
styles
.
SectionStyle
}
>
<
Text
style
=
{
styles
.
text
}
>
HELLO
<
/Text
>
<
Text
style
=
{
styles
.
text1
}
>
Sign
In
to
your
Account
<
/Text
>
<
/View
>
<
View
style
=
{
styles
.
textinputicon
}
>
<
Entypo
name
=
"
user
"
size
=
{
30
}
color
=
"
white
"
/>
<
TextInput
style
=
{
styles
.
input1
}
onChangeText
=
{(
val
)
=>
textInputChange
(
val
)
}
placeholder
=
"
Enter Email
"
//dummy@abc.com
placeholderTextColor
=
"
#8b9cb5
"
keyboardType
=
"
email-address
"
// onBlur={() => emailValidator()}
// onSubmitEditing={() =>
// passwordInputRef.current &&
// passwordInputRef.current.focus()
// }
blurOnSubmit
=
{
false
}
/
>
<
/View
>
{
data
.
isValidUser
?
null
:
<
Text
style
=
{
styles
.
errorMsg
}
>
Email
must
be
4
characters
long
<
/Text
>
}
<
/View
>
<
View
style
=
{
styles
.
SectionStyle
}
>
<
View
style
=
{
styles
.
SectionStyle
}
>
<
View
style
=
{
styles
.
textinputicon
}
>
<
View
style
=
{
styles
.
textinputicon
}
>
<
Entypo
name
=
"
lock
"
size
=
{
30
}
color
=
"
white
"
/>
<
Entypo
name
=
"
lock
"
size
=
{
30
}
color
=
"
white
"
/>
<
TextInput
<
TextInput
style
=
{
styles
.
input1
}
style
=
{
styles
.
input1
}
// onChangeText={(UserPassword) =>
onChangeText
=
{(
val
)
=>
// setUserPassword(UserPassword)
handlePasswordChange
(
val
)
// }
}
placeholder
=
"
Enter Password
"
//12345
placeholder
=
"
Enter Password
"
//12345
placeholderTextColor
=
"
#8b9cb5
"
placeholderTextColor
=
"
#8b9cb5
"
// ref={passwordInputRef}
// ref={passwordInputRef}
// onSubmitEditing={Keyboard.dismiss}
// onSubmitEditing={Keyboard.dismiss}
blurOnSubmit
=
{
false
}
blurOnSubmit
=
{
false
}
secureTextEntry
=
{
true
}
secureTextEntry
=
{
true
}
/
>
/
>
<
/View
>
<
/View
>
<
/View
>
{
data
.
isValidPassword
?
null
:
<
View
style
=
{
styles
.
buttons
}
>
<
Text
style
=
{
styles
.
errorMsg
}
>
Password
must
be
6
characters
long
.
<
/Text
>
<
TouchableOpacity
}
style
=
{
styles
.
buttonSub
}
<
/View
>
activeOpacity
=
{
0.5
}
<
View
style
=
{
styles
.
buttons
}
>
onPress
=
{()
=>
navigation
.
navigate
(
'
HomeScreen
'
)}
<
TouchableOpacity
>
style
=
{
styles
.
buttonSub
}
<
Text
style
=
{
styles
.
buttonTextStyle
}
>
LOGIN
<
/Text
>
activeOpacity
=
{
0.5
}
{
/* <ImageBackground source={require('../assets/loginex.jpg')} style={styles.imagebutton}/> */
}
onPress
=
{()
=>
navigation
.
navigate
(
"
HomeScreen
"
)}
<
/TouchableOpacity
>
>
<
Text
style
=
{
styles
.
buttonTextStyle
}
>
LOGIN
<
/Text
>
{
/* <ImageBackground source={require('../assets/loginex.jpg')} style={styles.imagebutton}/> */
}
<
/TouchableOpacity
>
<
View
style
=
{{
flexDirection
:
'
row
'
,
<
View
justifyContent
:
'
center
'
,
style
=
{{
alignItems
:
'
center
'
,}}
>
flexDirection
:
"
row
"
,
<
Text
style
=
{{
color
:
'
black
'
,
textAlign
:
'
center
'
}}
>
Dont
have
an
account
<
/Text
>
justifyContent
:
"
center
"
,
<
TouchableOpacity
style
=
{
styles
.
buttonSignUp
}
title
=
"
Sign Up
"
onPress
=
{()
=>
navigation
.
navigate
(
'
SignUp
'
)}
>
alignItems
:
"
center
"
,
<
Text
style
=
{
styles
.
buttonText
}
>
Sign
Up
<
/Text
>
}}
<
/TouchableOpacity
>
>
<
/View
>
<
Text
style
=
{{
color
:
"
black
"
,
textAlign
:
"
center
"
}}
>
<
/View
>
Dont
have
an
account
<
/View
>
<
/Text
>
<
/ImageBackground
>
<
TouchableOpacity
style
=
{
styles
.
buttonSignUp
}
title
=
"
Sign Up
"
onPress
=
{()
=>
navigation
.
navigate
(
"
SignUp
"
)}
>
<
Text
style
=
{
styles
.
buttonText
}
>
Sign
Up
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
)
<
/ImageBackground
>
<
/View
>
);
}
}
const
styles
=
StyleSheet
.
create
({
const
styles
=
StyleSheet
.
create
({
input
:
{
input
:
{
borderWidth
:
1
,
borderWidth
:
1
,
borderColor
:
'
#ddd
'
,
borderColor
:
"
#ddd
"
,
padding
:
10
,
padding
:
10
,
paddingTop
:
10
,
paddingTop
:
10
,
fontSize
:
15
,
fontSize
:
15
,
borderRadius
:
25
,
borderRadius
:
25
,
marginTop
:
20
,
marginTop
:
20
,
marginBottom
:
10
,
marginBottom
:
10
,
marginLeft
:
19
,
marginLeft
:
19
,
marginRight
:
19
,
marginRight
:
19
,
backgroundColor
:
'
white
'
,
backgroundColor
:
"
white
"
,
},
},
buttonSub
:
{
buttonSub
:
{
width
:
"
80%
"
,
width
:
"
80%
"
,
padding
:
10
,
padding
:
10
,
marginTop
:
30
,
marginTop
:
30
,
marginLeft
:
30
,
marginLeft
:
30
,
marginHorizontal
:
10
,
marginHorizontal
:
10
,
backgroundColor
:
"
#ff426e
"
,
backgroundColor
:
"
#ff426e
"
,
flexDirection
:
"
row
"
,
flexDirection
:
"
row
"
,
marginBottom
:
20
,
marginBottom
:
20
,
justifyContent
:
"
center
"
,
justifyContent
:
"
center
"
,
borderRadius
:
8
,
borderRadius
:
8
,
},
},
images
:
{
images
:
{
height
:
'
100%
'
,
height
:
"
100%
"
,
justifyContent
:
'
center
'
justifyContent
:
"
center
"
,
},
},
text
:
{
fontSize
:
30
,
alignSelf
:
"
center
"
,
marginTop
:
5
,
color
:
'
black
'
},
text1
:
{
fontSize
:
15
,
alignSelf
:
"
center
"
,
marginBottom
:
20
,
color
:
'
black
'
},
container
:
{
justifyContent
:
'
flex-start
'
,
alignContent
:
'
stretch
'
},
secondContainer
:
{
justifyContent
:
'
flex-start
'
,
},
text
:
{
textinputicon
:{
fontSize
:
30
,
// flex: 1,
alignSelf
:
"
center
"
,
flexDirection
:
'
row
'
,
marginTop
:
5
,
justifyContent
:
'
center
'
,
color
:
"
black
"
,
alignItems
:
'
center
'
,
},
// backgroundColor: '#fff',
text1
:
{
color
:
'
yellow
'
fontSize
:
15
,
alignSelf
:
"
center
"
,
},
marginBottom
:
20
,
input1
:{
color
:
"
black
"
,
borderWidth
:
1
,
},
borderColor
:
'
#ddd
'
,
container
:
{
padding
:
10
,
justifyContent
:
"
flex-start
"
,
// paddingTop: 10,
alignContent
:
"
stretch
"
,
fontSize
:
15
,
},
borderRadius
:
25
,
secondContainer
:
{
marginTop
:
20
,
justifyContent
:
"
flex-start
"
,
marginBottom
:
10
,
},
marginLeft
:
10
,
textinputicon
:
{
marginRight
:
19
,
// flex: 1,
backgroundColor
:
'
white
'
,
flexDirection
:
"
row
"
,
width
:
'
75%
'
justifyContent
:
"
center
"
,
},
alignItems
:
"
center
"
,
buttonSignUp
:{
// backgroundColor: '#fff',
width
:
"
20%
"
,
color
:
"
yellow
"
,
// padding: 10,
},
marginLeft
:
10
,
input1
:
{
// marginHorizontal: 10,
borderWidth
:
1
,
backgroundColor
:
"
#ff426e
"
,
borderColor
:
"
#ddd
"
,
flexDirection
:
"
row
"
,
padding
:
10
,
// marginBottom: 10,
// paddingTop: 10,
justifyContent
:
"
center
"
,
fontSize
:
15
,
borderRadius
:
8
borderRadius
:
25
,
}
marginTop
:
20
,
marginBottom
:
10
,
marginLeft
:
10
,
marginRight
:
19
,
backgroundColor
:
"
white
"
,
width
:
"
75%
"
,
},
buttonSignUp
:
{
width
:
"
20%
"
,
// padding: 10,
marginLeft
:
10
,
// marginHorizontal: 10,
backgroundColor
:
"
#ff426e
"
,
flexDirection
:
"
row
"
,
// marginBottom: 10,
justifyContent
:
"
center
"
,
borderRadius
:
8
,
},
errorMsg
:{
color
:
'
black
'
,
fontSize
:
14
,
alignSelf
:
"
center
"
}
});
});
screen/SignUp.js
View file @
0a075d5b
...
@@ -4,32 +4,87 @@ import { Formik } from 'formik';
...
@@ -4,32 +4,87 @@ import { Formik } from 'formik';
import
{
Entypo
}
from
'
@expo/vector-icons
'
;
import
{
Entypo
}
from
'
@expo/vector-icons
'
;
import
{
MaterialIcons
}
from
'
@expo/vector-icons
'
;
import
{
MaterialIcons
}
from
'
@expo/vector-icons
'
;
import
{
Ionicons
}
from
'
@expo/vector-icons
'
;
import
{
Ionicons
}
from
'
@expo/vector-icons
'
;
import
axios
from
'
axios
'
import
axios
from
'
axios
'
;
import
*
as
yup
from
'
yup
'
;
const
reviewSchema
=
yup
.
object
({
name
:
yup
.
string
().
required
().
min
(
2
),
email
:
yup
.
string
().
required
().
min
(
2
),
password
:
yup
.
string
().
required
().
min
(
2
),
district
:
yup
.
string
().
required
().
min
(
2
)
})
export
function
SignUp
({
navigation
})
{
export
function
SignUp
({
navigation
})
{
// const [submit, setSubmit] = useEffect();
// function handleSubmit()
// {
// useEffect(() => {
// axios.post('http://192.168.8.126:5000/users', {
// district: values.district,
// email: values.email,
// name: values.name,
// password: values.password,
// })
// .then(function (response){
// console.log(response + "logged")
// // return response;
// })
// .catch(function(error){
// console.log(error)
// })
// })
// }
return
(
return
(
<
View
style
=
{
styles
.
container
}
>
<
View
style
=
{
styles
.
container
}
>
<
ImageBackground
source
=
{
require
(
'
../assets/signup11.jpg
'
)}
style
=
{
styles
.
images
}
>
<
ImageBackground
source
=
{
require
(
'
../assets/signup11.jpg
'
)}
style
=
{
styles
.
images
}
>
<
Formik
<
Formik
initialValues
=
{{
name
:
''
,
email
:
''
,
password
:
''
,
district
:
''
}}
initialValues
=
{{
name
:
''
,
email
:
''
,
password
:
''
,
district
:
''
}}
onSubmit
=
{(
values
)
=>
{
validationSchema
=
{
reviewSchema
}
onSubmit
=
{(
values
,
actions
)
=>
{
// console.log(values);
// console.log(values);
axios
.
post
(
'
http://127.0.0.1:5000/users
'
,
{
// actions.submitForm();
name
:
values
.
name
,
const
valuesToBeSent
=
JSON
.
stringify
({
email
:
values
.
email
,
"
name
"
:
values
.
name
,
password
:
values
.
password
,
"
email
"
:
values
.
email
,
district
:
values
.
district
"
password
"
:
values
.
password
,
"
district
"
:
values
.
district
,
})
})
axios
.
post
(
'
http://192.168.8.126:5000/users
'
,
valuesToBeSent
)
// axios.get('http://192.168.8.126:5000/getUsers')
.
then
(
function
(
response
){
.
then
(
function
(
response
){
console
.
log
(
response
)
console
.
log
(
response
)
// return response;
})
})
.
catch
(
function
(
error
){
.
catch
(
function
(
error
){
console
.
log
(
error
)
console
.
log
(
error
)
})
})
}}
actions
.
resetForm
();
// useEffect(() => {
// axios.post('http://192.168.8.126:5000/users', {
// district: values.district,
// email: values.email,
// name: values.name,
// password: values.password,
// })
// .then(function (response){
// console.log(response + "logged")
// // return response;
// })
// .catch(function(error){
// console.log(error)
// })
// })
}}
>
>
{(
{
handleChange
,
handleSubmit
,
values
}
)
=>
(
{(
props
)
=>
(
<
View
>
<
View
>
<
Text
style
=
{
styles
.
heading
}
>
Sign
Up
<
/Text
>
<
Text
style
=
{
styles
.
heading
}
>
Sign
Up
<
/Text
>
...
@@ -44,10 +99,11 @@ export function SignUp({ navigation }) {
...
@@ -44,10 +99,11 @@ export function SignUp({ navigation }) {
<
TextInput
<
TextInput
style
=
{
styles
.
input
}
style
=
{
styles
.
input
}
placeholder
=
'
Name
'
placeholder
=
'
Name
'
onChangeText
=
{
handleChange
(
'
name
'
)}
onChangeText
=
{
props
.
handleChange
(
'
name
'
)}
value
=
{
values
.
name
}
value
=
{
props
.
values
.
name
}
/
>
/
>
<
/View
>
<
/View
>
<
Text
style
=
{
styles
.
errorText
}
>
{
props
.
errors
.
name
}
<
/Text
>
<
/View
>
<
/View
>
<
View
style
=
{
styles
.
container
}
>
<
View
style
=
{
styles
.
container
}
>
...
@@ -56,10 +112,12 @@ export function SignUp({ navigation }) {
...
@@ -56,10 +112,12 @@ export function SignUp({ navigation }) {
<
TextInput
<
TextInput
style
=
{
styles
.
input
}
style
=
{
styles
.
input
}
placeholder
=
'
Email
'
placeholder
=
'
Email
'
onChangeText
=
{
handleChange
(
'
email
'
)}
onChangeText
=
{
props
.
handleChange
(
'
email
'
)}
value
=
{
values
.
email
}
value
=
{
props
.
values
.
email
}
/
>
/
>
<
/View
>
<
/View
>
<
Text
style
=
{
styles
.
errorText
}
>
{
props
.
errors
.
email
}
<
/Text
>
<
/View
>
<
/View
>
...
@@ -70,10 +128,12 @@ export function SignUp({ navigation }) {
...
@@ -70,10 +128,12 @@ export function SignUp({ navigation }) {
style
=
{
styles
.
input
}
style
=
{
styles
.
input
}
multiline
multiline
placeholder
=
'
Password
'
placeholder
=
'
Password
'
onChangeText
=
{
handleChange
(
'
password
'
)}
onChangeText
=
{
props
.
handleChange
(
'
password
'
)}
value
=
{
values
.
password
}
value
=
{
props
.
values
.
password
}
/
>
/
>
<
/View
>
<
/View
>
<
Text
style
=
{
styles
.
errorText
}
>
{
props
.
errors
.
password
}
<
/Text
>
<
/View
>
<
/View
>
...
@@ -83,14 +143,16 @@ export function SignUp({ navigation }) {
...
@@ -83,14 +143,16 @@ export function SignUp({ navigation }) {
<
TextInput
<
TextInput
style
=
{
styles
.
input
}
style
=
{
styles
.
input
}
placeholder
=
'
District
'
placeholder
=
'
District
'
onChangeText
=
{
handleChange
(
'
district
'
)}
onChangeText
=
{
props
.
handleChange
(
'
district
'
)}
value
=
{
values
.
district
}
value
=
{
props
.
values
.
district
}
/
>
/
>
<
/View
>
<
/View
>
<
Text
style
=
{
styles
.
errorText
}
>
{
props
.
errors
.
district
}
<
/Text
>
<
/View
>
<
/View
>
<
View
>
<
View
>
<
TouchableOpacity
style
=
{
styles
.
buttonSub
}
title
=
"
Sign Up
"
onPress
=
{
handleSubmit
}
>
<
TouchableOpacity
style
=
{
styles
.
buttonSub
}
title
=
"
Sign Up
"
onPress
=
{
props
.
handleSubmit
}
>
<
Text
style
=
{
styles
.
buttonText
}
>
Sign
Up
<
/Text
>
<
Text
style
=
{
styles
.
buttonText
}
>
Sign
Up
<
/Text
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
...
@@ -132,7 +194,7 @@ const styles = StyleSheet.create({
...
@@ -132,7 +194,7 @@ const styles = StyleSheet.create({
color
:
'
#333
'
,
color
:
'
#333
'
,
padding
:
10
,
padding
:
10
,
width
:
"
100%
"
,
width
:
"
100%
"
,
justifyContent
:
'
flex-start
'
,
//
justifyContent: 'flex-start',
alignContent
:
'
stretch
'
,
alignContent
:
'
stretch
'
,
},
},
buttonSub
:
{
buttonSub
:
{
...
@@ -160,5 +222,9 @@ const styles = StyleSheet.create({
...
@@ -160,5 +222,9 @@ const styles = StyleSheet.create({
},
},
container
:
{
container
:
{
},
},
errorText
:{
color
:
"
black
"
,
alignSelf
:
"
center
"
}
});
});
\ No newline at end of file
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