improve auth flow

This commit is contained in:
Ammar Ahmed
2022-07-08 23:25:12 +05:00
parent 61b623f1e6
commit 79eb9cb7da
3 changed files with 27 additions and 30 deletions

View File

@@ -2,9 +2,11 @@ import React, { useEffect, useRef, useState } from 'react';
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/event-manager';
import { useThemeStore } from '../../stores/use-theme-store';
import { eCloseLoginDialog, eOpenLoginDialog } from '../../utils/events';
import { SIZE } from '../../utils/size';
import { sleep } from '../../utils/time';
import BaseDialog from '../dialog/base-dialog';
import { Toast } from '../toast';
import { Button } from '../ui/button';
import { IconButton } from '../ui/icon-button';
import { hideAuth, initialAuthMode } from './common';
import { Login } from './login';
@@ -88,6 +90,31 @@ const AuthModal = () => {
/>
)}
{initialAuthMode.current !== AuthMode.welcomeSignup ? null : (
<Button
title="Skip"
onPress={() => {
hideAuth();
}}
iconSize={20}
type="gray"
iconPosition="right"
icon="chevron-right"
height={25}
iconStyle={{
marginTop: 2
}}
style={{
position: 'absolute',
zIndex: 999,
right: 12,
top: 0,
marginTop: 12.5,
paddingHorizontal: 6
}}
/>
)}
<Toast context="local" />
</BaseDialog>
);

View File

@@ -267,21 +267,6 @@ export const Login = ({ changeMode, welcome }) => {
type="accent"
title={loading ? null : 'Login to your account'}
/>
{loading || !welcome ? null : (
<Button
style={{
marginTop: 10,
width: 250,
borderRadius: 100
}}
onPress={() => {
hideAuth();
}}
type="grayBg"
title="Skip for now"
/>
)}
</View>
</View>
</Animated.View>

View File

@@ -220,21 +220,6 @@ export const Signup = ({ changeMode, welcome, trial }) => {
type="accent"
title={loading ? null : 'Agree and continue'}
/>
{loading || !welcome ? null : (
<Button
style={{
marginTop: 10,
width: 250,
borderRadius: 100
}}
onPress={() => {
hideAuth();
}}
type="grayBg"
title="Skip for now"
/>
)}
</View>
<Paragraph