Skip to content

Commit

Permalink
update sdk version and minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
kamalkishor1991 committed Mar 7, 2024
1 parent d9d8308 commit e9c8ba7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ buildscript {
ext {
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
compileSdkVersion = 33
targetSdkVersion = 33
ndkVersion = "21.4.7075529"
androidXAnnotation = "1.1.0"
androidXBrowser = "1.0.0"
Expand Down
20 changes: 7 additions & 13 deletions screens/LoginScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,31 +53,25 @@ function checkValidEmail(email) {
}

function signUpValidations({ fullName, email, password, confirmPassword }) {
let fullNameError, emailError, passwordError;
const errors = {};

if (!fullName || fullName.length === 0) {
fullNameError = 'Full name required.';
errors.fullName = 'Full name required.';
}

if (!email || !checkValidEmail(email)) {
emailError = 'Please enter valid email.';
errors.email = 'Please enter a valid email.';
}

if (!password || password.length < 6) {
passwordError = 'Minimum 6 characters required in password.';
errors.password = 'Minimum 6 characters required in password.';
}

if (password !== confirmPassword) {
passwordError = 'Confirm password did not match.';
errors.password = 'Confirm password did not match.';
}
if (!fullNameError && !emailError && !passwordError) {
return undefined;
}
return {
fullName: fullNameError,
email: emailError,
password: passwordError
};

return Object.keys(errors).length > 0 ? errors : {};
}

function LoginScreen(props) {
Expand Down

0 comments on commit e9c8ba7

Please sign in to comment.