From dbb59fc9d35a7aa75f34393932d78e9524a1c83b Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Thu, 7 May 2020 01:43:56 +0500 Subject: [PATCH] minor fixes --- apps/mobile/src/views/Signup/index.js | 47 +++++++++++++++------------ 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/apps/mobile/src/views/Signup/index.js b/apps/mobile/src/views/Signup/index.js index ce88fdefe..225d04f36 100644 --- a/apps/mobile/src/views/Signup/index.js +++ b/apps/mobile/src/views/Signup/index.js @@ -10,12 +10,19 @@ import { } from 'react-native'; import {TextInput} from 'react-native-gesture-handler'; import QRCode from 'react-native-qrcode-generator'; -import { useIsFocused } from '@react-navigation/native'; +import {useIsFocused} from '@react-navigation/native'; import {opacity, pv, SIZE, WEIGHT, ph} from '../../common/common'; import {Header} from '../../components/header'; import {useTracked} from '../../provider'; -import {eSubscribeEvent, eUnSubscribeEvent} from '../../services/eventManager'; -import {eLoginDialogNavigateBack} from '../../services/events'; +import { + eSubscribeEvent, + eUnSubscribeEvent, + eSendEvent, +} from '../../services/eventManager'; +import { + eLoginDialogNavigateBack, + eCloseLoginDialog, +} from '../../services/events'; import * as Animatable from 'react-native-animatable'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import { @@ -32,7 +39,7 @@ const _pass = createRef(); const _username = createRef(); const _passConfirm = createRef(); const _passContainer = createRef(); -export const Signup = ({route,navigation}) => { +export const Signup = ({route, navigation}) => { const [state, dispatch] = useTracked(); const {colors, isLoginNavigator} = state; const [signingIn, setSigningIn] = useState(false); @@ -46,7 +53,9 @@ export const Signup = ({route,navigation}) => { const [failed, setFailed] = useState(false); const [modalVisible, setModalVisible] = useState(false); const [confirmPassword, setConfirmPassword] = useState(false); - const [key, setKey] = useState('xyzLLbr1tafjdfklsdfjlksafjhklfadsafsljkfsfadfljkdfassafsafaffasdfsafafs'); + const [key, setKey] = useState( + 'xyzLLbr1tafjdfklsdfjlksafjhklfadsafsljkfsfadfljkdfassafsafaffasdfsafafs', + ); const [passwordReEnter, setPasswordReEnter] = useState(null); const [secureEntry, setSecureEntry] = useState(true); let isFocused = useIsFocused(); @@ -83,7 +92,7 @@ export const Signup = ({route,navigation}) => { return; } - let user; + let user; try { user = await db.user.user.get(); setStatus('Logging you in...'); @@ -114,7 +123,7 @@ export const Signup = ({route,navigation}) => { { style={{ width: '100%', backgroundColor: colors.bg, + paddingHorizontal: DDS.isTab ? '20%' : '0%', height: '100%', alignItems: 'center', justifyContent: 'center', @@ -139,7 +149,6 @@ export const Signup = ({route,navigation}) => { }}> Hi there! - { textAlign: 'center', color: colors.pri, }}> - All your data is end-to-end encrypted. This - means that we cannot read your data or recover your password if - you forget it.{' '} + All your data is end-to-end encrypted. This means that we cannot + read your data or recover your password if you forget it.{' '} { fontSize: SIZE.sm, width: '85%', maxWidth: '85%', - paddingRight:10, + paddingRight: 10, color: colors.icon, }}> {key} @@ -219,8 +227,10 @@ export const Signup = ({route,navigation}) => { { + DDS.isTab + ? eSendEvent(eCloseLoginDialog) + : navigation.navigate('Home'); setModalVisible(false); - navigation.navigate('Home'); }} activeOpacity={opacity} style={{ @@ -502,7 +512,7 @@ export const Signup = ({route,navigation}) => { style={{ borderWidth: 1.5, borderColor: colors.nav, - paddingHorizontal:10, + paddingHorizontal: 10, borderRadius: 5, flexDirection: 'row', justifyContent: 'space-between', @@ -534,7 +544,6 @@ export const Signup = ({route,navigation}) => { borderColor: colors.errorText, }, }); - } else { setInvalidPassword(false); _passContainer.current?.setNativeProps({ @@ -566,8 +575,8 @@ export const Signup = ({route,navigation}) => { } }} style={{ - paddingVertical:pv, - paddingHorizontal:0, + paddingVertical: pv, + paddingHorizontal: 0, fontSize: SIZE.sm, fontFamily: WEIGHT.regular, width: '85%', @@ -671,7 +680,7 @@ export const Signup = ({route,navigation}) => { width: '100%', alignItems: 'center', justifyContent: 'center', - height: 150, + height: 75, }}> { @@ -703,6 +712,4 @@ export const Signup = ({route,navigation}) => { ); }; - - export default Signup;