Page MenuHomePhabricator

D13906.diff
No OneTemporary

D13906.diff

diff --git a/native/account/logged-out-modal.react.js b/native/account/logged-out-modal.react.js
--- a/native/account/logged-out-modal.react.js
+++ b/native/account/logged-out-modal.react.js
@@ -27,7 +27,10 @@
import { isLoggedIn } from 'lib/selectors/user-selectors.js';
import { recoveryFromReduxActionSources } from 'lib/types/account-types.js';
import { useDispatch } from 'lib/utils/redux-utils.js';
-import { usingCommServicesAccessToken } from 'lib/utils/services-utils.js';
+import {
+ usingCommServicesAccessToken,
+ usingRestoreFlow,
+} from 'lib/utils/services-utils.js';
import { splashBackgroundURI } from './background-info.js';
import FullscreenSIWEPanel from './fullscreen-siwe-panel.react.js';
@@ -57,7 +60,12 @@
let initialAppLoad = true;
const safeAreaEdges = ['top', 'bottom'];
-export type LoggedOutMode = 'loading' | 'prompt' | 'log-in' | 'siwe';
+export type LoggedOutMode =
+ | 'loading'
+ | 'prompt'
+ | 'log-in'
+ | 'siwe'
+ | 'restore';
const timingConfig = {
duration: 250,
@@ -426,6 +434,11 @@
combinedSetMode('log-in');
}, [combinedSetMode]);
+ const onPressRestore = React.useCallback(
+ () => combinedSetMode('restore'),
+ [combinedSetMode],
+ );
+
const { navigate } = props.navigation;
const onPressQRCodeSignIn = React.useCallback(() => {
navigate(QRCodeSignInNavigatorRouteName);
@@ -496,17 +509,19 @@
}
const signInButtons = [];
- signInButtons.push(
- <TouchableOpacity
- onPress={onPressLogIn}
- style={classicAuthButtonStyle}
- activeOpacity={0.6}
- key="login-form"
- >
- <Text style={classicAuthButtonTextStyle}>Sign in</Text>
- </TouchableOpacity>,
- );
- if (__DEV__) {
+ if (!usingRestoreFlow) {
+ signInButtons.push(
+ <TouchableOpacity
+ onPress={onPressLogIn}
+ style={classicAuthButtonStyle}
+ activeOpacity={0.6}
+ key="login-form"
+ >
+ <Text style={classicAuthButtonTextStyle}>Sign in</Text>
+ </TouchableOpacity>,
+ );
+ }
+ if (__DEV__ || usingRestoreFlow) {
signInButtons.push(
<TouchableOpacity
onPress={onPressQRCodeSignIn}
@@ -519,24 +534,48 @@
);
}
- return (
- <AnimatedView style={buttonsViewStyle}>
- <LoggedOutStaffInfo />
+ let siweSection = null;
+ if (!usingRestoreFlow) {
+ siweSection = (
+ <>
+ <TouchableOpacity
+ onPress={onPressSIWE}
+ style={siweAuthButtonStyle}
+ activeOpacity={0.6}
+ >
+ <View style={styles.siweIcon}>
+ <EthereumLogo />
+ </View>
+ <Text style={siweAuthButtonTextStyle}>Sign in with Ethereum</Text>
+ </TouchableOpacity>
+ <View style={styles.siweOr}>
+ <View style={styles.siweOrLeftHR} />
+ <Text style={styles.siweOrText}>or</Text>
+ <View style={styles.siweOrRightHR} />
+ </View>
+ </>
+ );
+ }
+
+ let restoreButton = null;
+ if (usingRestoreFlow) {
+ restoreButton = (
<TouchableOpacity
- onPress={onPressSIWE}
- style={siweAuthButtonStyle}
+ onPress={onPressRestore}
+ style={classicAuthButtonStyle}
activeOpacity={0.6}
+ key="qr-code-login"
>
- <View style={styles.siweIcon}>
- <EthereumLogo />
- </View>
- <Text style={siweAuthButtonTextStyle}>Sign in with Ethereum</Text>
+ <Text style={classicAuthButtonTextStyle}>Restore</Text>
</TouchableOpacity>
- <View style={styles.siweOr}>
- <View style={styles.siweOrLeftHR} />
- <Text style={styles.siweOrText}>or</Text>
- <View style={styles.siweOrRightHR} />
- </View>
+ );
+ }
+
+ return (
+ <AnimatedView style={buttonsViewStyle}>
+ <LoggedOutStaffInfo />
+ {siweSection}
+ {restoreButton}
<View style={styles.signInButtons}>{signInButtons}</View>
<View style={styles.registerButtons}>
<TouchableOpacity
@@ -555,6 +594,7 @@
onPressNewRegister,
onPressLogIn,
onPressQRCodeSignIn,
+ onPressRestore,
onPressSIWE,
classicAuthButtonStyle,
classicAuthButtonTextStyle,

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 15, 8:28 AM (18 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2493586
Default Alt Text
D13906.diff (4 KB)

Event Timeline