mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
fix login page
This commit is contained in:
@@ -1,29 +1,29 @@
|
||||
import CheckBox from '@react-native-community/checkbox';
|
||||
import React, { createRef, useEffect, useState } from 'react';
|
||||
import { Clipboard, Modal, Text, TouchableOpacity, View } from 'react-native';
|
||||
import { TextInput } from 'react-native-gesture-handler';
|
||||
import React, {createRef, useEffect, useState} from 'react';
|
||||
import {Clipboard, Modal, Text, TouchableOpacity, View} from 'react-native';
|
||||
import {TextInput} from 'react-native-gesture-handler';
|
||||
import QRCode from 'react-native-qrcode-generator';
|
||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||
import {useSafeAreaInsets} from 'react-native-safe-area-context';
|
||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||
import { opacity, ph, pv, SIZE, WEIGHT } from '../../common/common';
|
||||
import { Button } from '../../components/Button';
|
||||
import {opacity, ph, pv, SIZE, WEIGHT} from '../../common/common';
|
||||
import {Button} from '../../components/Button';
|
||||
import Seperator from '../../components/Seperator';
|
||||
import { Toast } from '../../components/Toast';
|
||||
import { ACTIONS } from '../../provider/actions';
|
||||
import { useTracked } from '../../provider/index';
|
||||
import {Toast} from '../../components/Toast';
|
||||
import {ACTIONS} from '../../provider/actions';
|
||||
import {useTracked} from '../../provider/index';
|
||||
import {
|
||||
eSendEvent,
|
||||
eSubscribeEvent,
|
||||
eUnSubscribeEvent
|
||||
eUnSubscribeEvent,
|
||||
} from '../../services/eventManager';
|
||||
import { eCloseLoginDialog, eOpenLoginDialog } from '../../services/events';
|
||||
import {eCloseLoginDialog, eOpenLoginDialog, eStartSyncer, refreshNotesPage} from '../../services/events';
|
||||
import {
|
||||
validateEmail,
|
||||
validatePass,
|
||||
validateUsername
|
||||
validateUsername,
|
||||
} from '../../services/validation';
|
||||
import { db, DDS, getElevation, ToastEvent } from '../../utils/utils';
|
||||
import { Loading } from '../Loading';
|
||||
import {db, DDS, getElevation, ToastEvent} from '../../utils/utils';
|
||||
import {Loading} from '../Loading';
|
||||
|
||||
const LoginDialog = () => {
|
||||
const [state, dispatch] = useTracked();
|
||||
@@ -394,7 +394,6 @@ const LoginDialog = () => {
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
{login ? null : (
|
||||
<>
|
||||
<TextInput
|
||||
ref={_username}
|
||||
@@ -409,10 +408,7 @@ const LoginDialog = () => {
|
||||
}}
|
||||
defaultValue={username}
|
||||
onBlur={() => {
|
||||
if (
|
||||
!validateUsername(username) &&
|
||||
username?.length > 0
|
||||
) {
|
||||
if (!validateUsername(username) && username?.length > 0) {
|
||||
setInvalidUsername(true);
|
||||
_username.current.setNativeProps({
|
||||
style: {
|
||||
@@ -483,10 +479,11 @@ const LoginDialog = () => {
|
||||
</Text>
|
||||
) : null}
|
||||
</>
|
||||
)}
|
||||
|
||||
<Seperator />
|
||||
|
||||
{login ? null : (
|
||||
<>
|
||||
<TextInput
|
||||
ref={_email}
|
||||
onFocus={() => {
|
||||
@@ -567,11 +564,14 @@ const LoginDialog = () => {
|
||||
size={SIZE.xs}
|
||||
color={colors.errorText}
|
||||
/>{' '}
|
||||
Password is invalid
|
||||
Email is invalid
|
||||
</Text>
|
||||
) : null}
|
||||
|
||||
<Seperator />
|
||||
</>
|
||||
)}
|
||||
|
||||
|
||||
|
||||
<View
|
||||
ref={_passContainer}
|
||||
|
||||
Reference in New Issue
Block a user