|
|
@ -20,8 +20,6 @@ function SignIn(props: { navigation: any; }) {
|
|
|
|
const setUser = useUserStore((state) => state.setUser);
|
|
|
|
const setUser = useUserStore((state) => state.setUser);
|
|
|
|
|
|
|
|
|
|
|
|
const errorList = useSelector((state: RootState) => state.credentialErrors.loginErrorList);
|
|
|
|
const errorList = useSelector((state: RootState) => state.credentialErrors.loginErrorList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const [pseudo, setPseudo] = useState('');
|
|
|
|
const [pseudo, setPseudo] = useState('');
|
|
|
|
const [password, setPassword] = useState('');
|
|
|
|
const [password, setPassword] = useState('');
|
|
|
|
const dispatch=useDispatch();
|
|
|
|
const dispatch=useDispatch();
|
|
|
@ -32,7 +30,6 @@ function SignIn(props: { navigation: any; }) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleUserConnect = useCallback(async (pseudo: string, password: string) => {
|
|
|
|
const handleUserConnect = useCallback(async (pseudo: string, password: string) => {
|
|
|
|
|
|
|
|
|
|
|
|
const us =await MANAGER_USER.getLoaderUser().loadByUsernamePassword(pseudo, password).then((res) => {
|
|
|
|
const us =await MANAGER_USER.getLoaderUser().loadByUsernamePassword(pseudo, password).then((res) => {
|
|
|
@ -52,17 +49,16 @@ function SignIn(props: { navigation: any; }) {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<View style={stylesScreen.container}>
|
|
|
|
<View style={stylesScreen.container}>
|
|
|
|
<View style={stylesScreen.bodyCenter}>
|
|
|
|
<View style={stylesScreen.bodyCenter}>
|
|
|
|
|
|
|
|
|
|
|
|
<TextInput style={styles.textInput} placeholder='Login' onChangeText={(val) => setPseudo(val)} autoCapitalize='none' />
|
|
|
|
<TextInput style={styles.textInput} placeholder='Login' onChangeText={(val) => setPseudo(val)} autoCapitalize='none' />
|
|
|
|
<TextInput style={styles.textInput} placeholder='Password' onChangeText={(val) => setPassword(val)} autoCapitalize='none' secureTextEntry={true}/>
|
|
|
|
<TextInput style={styles.textInput} placeholder='Password' onChangeText={(val) => setPassword(val)} autoCapitalize='none' secureTextEntry={true}/>
|
|
|
|
<Pressable style={styles.button} onPress={() => handleUserConnect(pseudo, password)}>
|
|
|
|
<Pressable style={styles.button} onPress={() => handleUserConnect(pseudo, password)}>
|
|
|
|
<Text style={styles.text}>Se connecter</Text>
|
|
|
|
<Text style={styles.text}>Se connecter</Text>
|
|
|
|
</Pressable>
|
|
|
|
</Pressable>
|
|
|
|
|
|
|
|
|
|
|
|
<Pressable onPress={() => navigation.navigate('SignUp')}>
|
|
|
|
<Pressable onPress={() => navigation.navigate('SignUp')}>
|
|
|
|
<Text style={styles.textLink}>Pas de compte? Inscrivez vous !</Text>
|
|
|
|
<Text style={styles.textLink}>Pas de compte? Inscrivez vous !</Text>
|
|
|
|
</Pressable>
|
|
|
|
</Pressable>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
|
|
|
|
{/*
|
|
|
|
<Dialog.Container visible={false}>
|
|
|
|
<Dialog.Container visible={false}>
|
|
|
|
<Dialog.Title>Ce pseudo n'exsite pas</Dialog.Title>
|
|
|
|
<Dialog.Title>Ce pseudo n'exsite pas</Dialog.Title>
|
|
|
|
<Dialog.Button label="Fermer" onPress={() => dispatch(updateIncorrectCredentials(false))} />
|
|
|
|
<Dialog.Button label="Fermer" onPress={() => dispatch(updateIncorrectCredentials(false))} />
|
|
|
@ -71,6 +67,7 @@ function SignIn(props: { navigation: any; }) {
|
|
|
|
<Dialog.Title>Mot de passe incorrect</Dialog.Title>
|
|
|
|
<Dialog.Title>Mot de passe incorrect</Dialog.Title>
|
|
|
|
<Dialog.Button label="Fermer" onPress={() => dispatch(updateIncorrectCredentials(false))} />
|
|
|
|
<Dialog.Button label="Fermer" onPress={() => dispatch(updateIncorrectCredentials(false))} />
|
|
|
|
</Dialog.Container>
|
|
|
|
</Dialog.Container>
|
|
|
|
|
|
|
|
*/}
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|