Skip to content

Commit

Permalink
Update LoginScreen.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
Loule95450 committed Feb 28, 2024
1 parent cd17bae commit e9b78f7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/screens/login/LoginScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ const LoginScreen = () => {
navigation.navigate(ACCOUNT_NAVIGATOR_ROUTES.REGISTER);
}

function validateEmail(email) {
function validateEmail(email: string): boolean {

Check warning

Code scanning / ESLint

Disallow variable declarations from shadowing variables declared in the outer scope Warning

'email' is already declared in the upper scope on line 20 column 10.
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
return emailRegex.test(email);
}
function validatePassword(password) {

function validatePassword(password: string): boolean {

Check warning

Code scanning / ESLint

Disallow variable declarations from shadowing variables declared in the outer scope Warning

'password' is already declared in the upper scope on line 21 column 10.
const passwordRegex = /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$/;
return passwordRegex.test(password);
}
Expand Down Expand Up @@ -78,13 +79,15 @@ const LoginScreen = () => {
placeholder="Adresse email"
textContentType={'emailAddress'}
style={styles.textInput}
placeholderTextColor="black"
onChangeText={text => setEmail(text)}
/>
<TextInput
placeholder="Mot de passe"
textContentType={'password'}
style={styles.passwordInput}
secureTextEntry={true}
placeholderTextColor="black"
onChangeText={text => setPassword(text)}
/>
</View>
Expand Down

0 comments on commit e9b78f7

Please sign in to comment.