Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

ui: improve login ux

ammarahm-ed3d3b6036fd38
diff --git a/apps/mobile/src/views/Login/index.js b/apps/mobile/src/views/Login/index.js
index 8102b07d4..47118b29f 100644
--- a/apps/mobile/src/views/Login/index.js
+++ b/apps/mobile/src/views/Login/index.js
@@ -208,7 +208,7 @@ export const Login = ({navigation}) => {
}}
defaultValue={username}
onBlur={() => {
- if (!validateUsername(username)) {
+ if (!validateUsername(username) && username.length > 0) {
setInvalidUsername(true);
_username.current.setNativeProps({
style: {
@@ -217,6 +217,7 @@ export const Login = ({navigation}) => {
},
});
} else {
+ setInvalidUsername(false);
_username.current.setNativeProps({
style: {
borderColor: colors.nav,
@@ -378,7 +379,7 @@ export const Login = ({navigation}) => {
}}
defaultValue={password}
onBlur={() => {
- if (!validatePass(password)) {
+ if (!validatePass(password) && password.length > 0) {
setInvalidPassword(true);
_pass.current.setNativeProps({
style: {
@@ -387,6 +388,7 @@ export const Login = ({navigation}) => {
},
});
} else {
+ setInvalidPassword(false);
_pass.current.setNativeProps({
style: {
borderColor: colors.nav,
diff --git a/apps/mobile/src/views/Signup/index.js b/apps/mobile/src/views/Signup/index.js
index 9eb7d0fa9..4a0aea022 100644
--- a/apps/mobile/src/views/Signup/index.js
+++ b/apps/mobile/src/views/Signup/index.js
@@ -171,7 +171,7 @@ export const Signup = ({navigation}) => {
}}
defaultValue={username}
onBlur={() => {
- if (!validateUsername(username)) {
+ if (!validateUsername(username) && username.length > 0) {
setInvalidUsername(true);
_username.current.setNativeProps({
style: {
@@ -180,6 +180,7 @@ export const Signup = ({navigation}) => {
},
});
} else {
+ setInvalidUsername(false);
_username.current.setNativeProps({
style: {
borderColor: colors.nav,
@@ -262,7 +263,7 @@ export const Signup = ({navigation}) => {
}}
defaultValue={email}
onBlur={() => {
- if (!validateEmail(email)) {
+ if (!validateEmail(email) && email.length > 0) {
setInvalidEmail(true);
_email.current.setNativeProps({
style: {
@@ -271,6 +272,7 @@ export const Signup = ({navigation}) => {
},
});
} else {
+ setInvalidEmail(false);
_email.current.setNativeProps({
style: {
borderColor: colors.nav,
@@ -352,7 +354,7 @@ export const Signup = ({navigation}) => {
}}
defaultValue={password}
onBlur={() => {
- if (!validatePass(password)) {
+ if (!validatePass(password) && password.length > 0) {
setInvalidPassword(true);
_pass.current.setNativeProps({
style: {
@@ -361,6 +363,7 @@ export const Signup = ({navigation}) => {
},
});
} else {
+ setInvalidPassword(false);
_pass.current.setNativeProps({
style: {
borderColor: colors.nav,