Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3334526
D13906.id45746.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D13906.id45746.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 22, 6:57 AM (18 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2560509
Default Alt Text
D13906.id45746.diff (4 KB)
Attached To
Mode
D13906: [native] Introduce a restore button
Attached
Detach File
Event Timeline
Log In to Comment