Skip to content

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

fix signup pass input

ammarahm-ed1f2c0b360ea1
diff --git a/apps/mobile/src/views/Login/index.js b/apps/mobile/src/views/Login/index.js
index 06babd7d5..a642187e0 100644
--- a/apps/mobile/src/views/Login/index.js
+++ b/apps/mobile/src/views/Login/index.js
@@ -17,7 +17,7 @@ import {ACTIONS} from '../../provider/actions';
import {eSendEvent} from '../../services/eventManager';
import {eCloseSideMenu, refreshNotesPage} from '../../services/events';
import {validatePass, validateUsername} from '../../services/validation';
-import {db, DDS, ToastEvent} from '../../utils/utils';
+import {db, DDS, ToastEvent, getElevation} from '../../utils/utils';
export const Login = ({navigation}) => {
const [state, dispatch] = useTracked();
@@ -374,7 +374,7 @@ export const Login = ({navigation}) => {
<View
style={{
- padding: pv,
+
borderWidth: 1.5,
borderColor: colors.nav,
borderRadius: 5,
@@ -436,7 +436,7 @@ export const Login = ({navigation}) => {
}
}}
style={{
- padding: 0,
+ padding:pv,
fontSize: SIZE.sm,
fontFamily: WEIGHT.regular,
width: '85%',
@@ -455,6 +455,7 @@ export const Login = ({navigation}) => {
}}
style={{
width: 25,
+ marginRight:10
}}
color={secureEntry ? colors.icon : colors.accent}
/>
@@ -487,12 +488,14 @@ export const Login = ({navigation}) => {
activeOpacity={opacity}
onPress={_logIn}
style={{
+ ...getElevation(10),
padding: pv,
backgroundColor: colors.accent,
borderRadius: 5,
marginHorizontal: 12,
marginBottom: 10,
alignItems: 'center',
+
}}>
<Text
style={{
@@ -529,7 +532,7 @@ export const Login = ({navigation}) => {
style={{
color: colors.accent,
}}>
- Register now
+ Sign Up
</Text>
</Text>
</TouchableOpacity>
diff --git a/apps/mobile/src/views/Signup/index.js b/apps/mobile/src/views/Signup/index.js
index da9a91648..8c61bc63d 100644
--- a/apps/mobile/src/views/Signup/index.js
+++ b/apps/mobile/src/views/Signup/index.js
@@ -23,7 +23,7 @@ import {
validateEmail,
validatePass,
} from '../../services/validation';
-import {ToastEvent, db, DDS} from '../../utils/utils';
+import {ToastEvent, db, DDS, getElevation} from '../../utils/utils';
import {ACTIONS} from '../../provider/actions';
import {Toast} from '../../components/Toast';
@@ -62,17 +62,15 @@ export const Signup = ({navigation}) => {
}, [isFocused]);
const _signUp = async () => {
-
- if (!password || !email || !username || !passwordReEnter){
- ToastEvent.show('All fields are required', 'error');
+ if (!password || !email || !username || !passwordReEnter) {
+ ToastEvent.show('All fields are required', 'error');
return;
}
- if (!confirmPassword){
- ToastEvent.show('Passwords do not match', 'error');
+ if (!confirmPassword) {
+ ToastEvent.show('Passwords do not match', 'error');
return;
}
-
setSigningIn(true);
setStatus('Creating new user...');
if (!invalidEmail && !invalidPassword && !invalidUsername) {
@@ -476,175 +474,176 @@ export const Signup = ({navigation}) => {
/>
</View>
<View
+ style={{
+ marginBottom: 15,
+ marginTop: 15,
+ justifyContent: 'center',
+ }}>
+ <Text
style={{
- marginBottom: 15,
- marginTop: 15,
- justifyContent: 'center',
+ textAlign: 'right',
+ marginHorizontal: 12,
+ fontFamily: WEIGHT.regular,
+ textAlignVertical: 'bottom',
+ position: 'absolute',
+ right: 5,
+ top: 2.5,
}}>
- <Text
+ {invalidPassword ? (
+ <Icon
+ name="alert-circle-outline"
+ size={SIZE.xs}
+ color={colors.errorText}
+ />
+ ) : null}
+ </Text>
+
+ <View
+ style={{
+ borderWidth: 1.5,
+ borderColor: colors.nav,
+ borderRadius: 5,
+ flexDirection: 'row',
+ justifyContent: 'space-between',
+ alignItems: 'center',
+ marginHorizontal: 12,
+ }}>
+ <TextInput
+ ref={_pass}
+ onFocus={() => {
+ if (!invalidPassword) {
+ _pass.current.setNativeProps({
+ style: {
+ borderColor: colors.accent,
+ },
+ });
+ }
+ }}
+ defaultValue={password}
+ onBlur={() => {
+ if (!validatePass(password) && password?.length > 0) {
+ setInvalidPassword(true);
+ _pass.current.setNativeProps({
+ style: {
+ color: colors.errorText,
+ borderColor: colors.errorText,
+ },
+ });
+ } else {
+ setInvalidPassword(false);
+ _pass.current.setNativeProps({
+ style: {
+ borderColor: colors.nav,
+ },
+ });
+ }
+ }}
+ onChangeText={value => {
+ setPassword(value);
+ if (invalidPassword && validatePass(password)) {
+ setInvalidPassword(false);
+ _pass.current.setNativeProps({
+ style: {
+ color: colors.pri,
+ borderColor: colors.accent,
+ },
+ });
+ }
+ }}
+ onSubmitEditing={() => {
+ if (!validatePass(password)) {
+ setInvalidPassword(true);
+ _pass.current.setNativeProps({
+ style: {
+ color: colors.errorText,
+ },
+ });
+ }
+ }}
style={{
- textAlign: 'right',
- marginHorizontal: 12,
+ padding:pv,
+ fontSize: SIZE.sm,
fontFamily: WEIGHT.regular,
- textAlignVertical: 'bottom',
- position: 'absolute',
- right: 5,
- top: 2.5,
- }}>
- {invalidPassword ? (
- <Icon
- name="alert-circle-outline"
- size={SIZE.xs}
- color={colors.errorText}
- />
- ) : null}
- </Text>
+ width: '85%',
+ maxWidth: '85%',
+ }}
+ secureTextEntry={secureEntry}
+ placeholder="Password"
+ placeholderTextColor={colors.icon}
+ />
- <View
+ <Icon
+ name="eye"
+ size={20}
+ onPress={() => {
+ setSecureEntry(!secureEntry);
+ }}
style={{
- padding: pv,
- borderWidth: 1.5,
- borderColor: colors.nav,
- borderRadius: 5,
- flexDirection: 'row',
- justifyContent: 'space-between',
- alignItems: 'center',
- marginHorizontal: 12,
- }}>
- <TextInput
- ref={_pass}
- onFocus={() => {
- if (!invalidPassword) {
- _pass.current.setNativeProps({
- style: {
- borderColor: colors.accent,
- },
- });
- }
- }}
- defaultValue={password}
- onBlur={() => {
- if (!validatePass(password) && password?.length > 0) {
- setInvalidPassword(true);
- _pass.current.setNativeProps({
- style: {
- color: colors.errorText,
- borderColor: colors.errorText,
- },
- });
- } else {
- setInvalidPassword(false);
- _pass.current.setNativeProps({
- style: {
- borderColor: colors.nav,
- },
- });
- }
- }}
- onChangeText={value => {
- setPassword(value);
- if (invalidPassword && validatePass(password)) {
- setInvalidPassword(false);
- _pass.current.setNativeProps({
- style: {
- color: colors.pri,
- borderColor: colors.accent,
- },
- });
- }
- }}
- onSubmitEditing={() => {
- if (!validatePass(password)) {
- setInvalidPassword(true);
- _pass.current.setNativeProps({
- style: {
- color: colors.errorText,
- },
- });
- }
- }}
- style={{
- padding: 0,
- fontSize: SIZE.sm,
- fontFamily: WEIGHT.regular,
- width: '85%',
- maxWidth: '85%',
- }}
- secureTextEntry={secureEntry}
- placeholder="Password"
- placeholderTextColor={colors.icon}
- />
-
- <Icon
- name="eye"
- size={20}
- onPress={() => {
- setSecureEntry(!secureEntry);
- }}
- style={{
- width: 25,
- }}
- color={secureEntry ? colors.icon : colors.accent}
- />
- </View>
- </View>
+ width: 25,
+ marginRight:10
+ }}
+ color={secureEntry ? colors.icon : colors.accent}
+ />
+ </View>
+ </View>
<TextInput
- ref={_passConfirm}
- editable={password && !invalidPassword ? true : false}
- defaultValue={passwordReEnter}
- onChangeText={value => {
- setPasswordReEnter(value);
- if (value !== password) {
- setConfirmPassword(false);
- _passConfirm.current.setNativeProps({
- style: {
- borderColor: colors.errorText,
- },
- });
- _pass.current.setNativeProps({
- style: {
- borderColor: colors.errorText,
- },
- });
- } else {
- setConfirmPassword(true);
- _passConfirm.current.setNativeProps({
- style: {
- borderColor: colors.accent,
- },
- });
- _pass.current.setNativeProps({
- style: {
- borderColor: colors.accent,
- },
- });
- }
- }}
- onFocus={() => {
+ ref={_passConfirm}
+ editable={password && !invalidPassword ? true : false}
+ defaultValue={passwordReEnter}
+ onChangeText={value => {
+ setPasswordReEnter(value);
+ if (value !== password) {
+ setConfirmPassword(false);
+ _passConfirm.current.setNativeProps({
+ style: {
+ borderColor: colors.errorText,
+ },
+ });
+ _pass.current.setNativeProps({
+ style: {
+ borderColor: colors.errorText,
+ },
+ });
+ } else {
+ setConfirmPassword(true);
_passConfirm.current.setNativeProps({
style: {
borderColor: colors.accent,
},
});
- }}
- style={{
- padding: pv,
- borderWidth: 1.5,
- borderColor: colors.nav,
- marginHorizontal: 12,
- borderRadius: 5,
- marginBottom: 12,
- fontSize: SIZE.sm,
- fontFamily: WEIGHT.regular,
- }}
- secureTextEntry={secureEntry}
- placeholder="Confirm Password"
- placeholderTextColor={colors.icon}
- />
+ _pass.current.setNativeProps({
+ style: {
+ borderColor: colors.accent,
+ },
+ });
+ }
+ }}
+ onFocus={() => {
+ _passConfirm.current.setNativeProps({
+ style: {
+ borderColor: colors.accent,
+ },
+ });
+ }}
+ style={{
+ padding: pv,
+ borderWidth: 1.5,
+ borderColor: colors.nav,
+ marginHorizontal: 12,
+ borderRadius: 5,
+ marginBottom: 12,
+ fontSize: SIZE.sm,
+ fontFamily: WEIGHT.regular,
+ }}
+ secureTextEntry={secureEntry}
+ placeholder="Confirm Password"
+ placeholderTextColor={colors.icon}
+ />
<TouchableOpacity
activeOpacity={opacity}
onPress={_signUp}
style={{
+ ...getElevation(10),
padding: pv,
backgroundColor: colors.accent,
borderRadius: 5,
@@ -658,7 +657,7 @@ export const Signup = ({navigation}) => {
fontFamily: WEIGHT.medium,
color: 'white',
}}>
- Signup
+ Sign Up
</Text>
</TouchableOpacity>
</View>