From 6a82ff4c4d34373bcdf8af9cfa10b6bf4938ab67 Mon Sep 17 00:00:00 2001 From: Quentin Legot Date: Thu, 24 Feb 2022 12:55:27 +0100 Subject: [PATCH] Add signup (not work) --- .gitignore | 2 + Navigation/Navigation.js | 2 +- Screen/SignInScreen.js | 30 +- Screen/SignOutScreen.js | 8 +- Screen/SignUpScreen.js | 55 +- Screen/TodoListsScreen.js | 2 +- components/SignUp.js | 32 + package-lock.json | 2434 +++++++++++++++++++++++++++++-------- package.json | 13 +- 9 files changed, 2026 insertions(+), 552 deletions(-) create mode 100644 components/SignUp.js diff --git a/.gitignore b/.gitignore index ec8a36a..e8f8a11 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,5 @@ web-build/ # macOS .DS_Store + +.vscode \ No newline at end of file diff --git a/Navigation/Navigation.js b/Navigation/Navigation.js index 605edbf..54981bc 100644 --- a/Navigation/Navigation.js +++ b/Navigation/Navigation.js @@ -12,7 +12,7 @@ import SignUpScreen from '../Screen/SignUpScreen' const Tab = createBottomTabNavigator() -export default function App() { +export default function Navigation() { return ( {([token, setToken]) => ( diff --git a/Screen/SignInScreen.js b/Screen/SignInScreen.js index 2ed6110..2e780fa 100644 --- a/Screen/SignInScreen.js +++ b/Screen/SignInScreen.js @@ -1,10 +1,9 @@ import React, { useContext, useState } from 'react' -import { Text, TextInput, StyleSheet } from 'react-native' -import signIn from '../components/SignIn.js' -import { UsernameContext, TokenContext } from '../Context/Context.js' +import { Text, TextInput, StyleSheet, Button, View } from 'react-native' +import signIn from '../components/SignIn' +import { UsernameContext, TokenContext } from '../Context/Context' - -export default function SignInScreen() { +export default function SignInScreen({ navigation }) { const [ username, setUsername] = useContext(UsernameContext) const [ token, setToken] = useContext(TokenContext) const [ password, setPassword] = useState("") @@ -14,8 +13,8 @@ export default function SignInScreen() { signIn(username, password) .then(token => { setToken(token) - setUsername(login) - props.navigate('Home') + setUsername(username) + navigation.navigate('Home') }) .catch(err => { setError(err) @@ -23,21 +22,34 @@ export default function SignInScreen() { } return ( - <> + {error} Nom d'utilisateur: Mot de passe: - + +