Page MenuHomePhabricator

D13906.id45847.diff
No OneTemporary

D13906.id45847.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,
@@ -496,17 +504,20 @@
}
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) {
+ const buttonText = usingRestoreFlow ? 'Sign in' : 'Sign in (QR)';
signInButtons.push(
<TouchableOpacity
onPress={onPressQRCodeSignIn}
@@ -514,29 +525,38 @@
activeOpacity={0.6}
key="qr-code-login"
>
- <Text style={classicAuthButtonTextStyle}>Sign in (QR)</Text>
+ <Text style={classicAuthButtonTextStyle}>{buttonText}</Text>
</TouchableOpacity>,
);
}
+ 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>
+ </>
+ );
+ }
+
return (
<AnimatedView style={buttonsViewStyle}>
<LoggedOutStaffInfo />
- <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>
+ {siweSection}
<View style={styles.signInButtons}>{signInButtons}</View>
<View style={styles.registerButtons}>
<TouchableOpacity
diff --git a/native/qr-code/qr-code-screen.react.js b/native/qr-code/qr-code-screen.react.js
--- a/native/qr-code/qr-code-screen.react.js
+++ b/native/qr-code/qr-code-screen.react.js
@@ -8,8 +8,10 @@
import { qrCodeLinkURL } from 'lib/facts/links.js';
import { platformToIdentityDeviceType } from 'lib/types/identity-service-types.js';
import { getConfig } from 'lib/utils/config.js';
+import { usingRestoreFlow } from 'lib/utils/services-utils.js';
import type { QRCodeSignInNavigationProp } from './qr-code-sign-in-navigator.react.js';
+import LinkButton from '../components/link-button.react.js';
import type { NavigationRoute } from '../navigation/route-names.js';
import { useStyles } from '../themes/colors.js';
@@ -37,34 +39,50 @@
}, [platform, qrData]);
const styles = useStyles(unboundStyles);
+
+ let primaryRestoreButton = null;
+ if (usingRestoreFlow) {
+ primaryRestoreButton = (
+ <View style={styles.primaryRestoreButton}>
+ <LinkButton text="Not logged in on another phone?" onPress={() => {}} />
+ </View>
+ );
+ }
+
return (
- <View style={styles.container}>
- <Text style={styles.heading}>Log in to Comm</Text>
- <Text style={styles.headingSubtext}>
- Open the Comm app on your phone and scan the QR code below
- </Text>
- <QRCode value={qrCodeURL} size={200} />
- <View style={styles.instructionsBox}>
- <Text style={styles.instructionsTitle}>How to find the scanner:</Text>
- <Text style={styles.instructionsStep}>
- <Text>Go to </Text>
- <Text style={styles.instructionsBold}>Profile</Text>
- </Text>
- <Text style={styles.instructionsStep}>
- <Text>Select </Text>
- <Text style={styles.instructionsBold}>Linked devices </Text>
- </Text>
- <Text style={styles.instructionsStep}>
- <Text>Click </Text>
- <Text style={styles.instructionsBold}>Add </Text>
- <Text>on the top right</Text>
+ <View style={styles.screenContainer}>
+ <View style={styles.container}>
+ <Text style={styles.heading}>Log in to Comm</Text>
+ <Text style={styles.headingSubtext}>
+ Open the Comm app on your phone and scan the QR code below
</Text>
+ <QRCode value={qrCodeURL} size={200} />
+ <View style={styles.instructionsBox}>
+ <Text style={styles.instructionsTitle}>How to find the scanner:</Text>
+ <Text style={styles.instructionsStep}>
+ <Text>Go to </Text>
+ <Text style={styles.instructionsBold}>Profile</Text>
+ </Text>
+ <Text style={styles.instructionsStep}>
+ <Text>Select </Text>
+ <Text style={styles.instructionsBold}>Linked devices </Text>
+ </Text>
+ <Text style={styles.instructionsStep}>
+ <Text>Click </Text>
+ <Text style={styles.instructionsBold}>Add </Text>
+ <Text>on the top right</Text>
+ </Text>
+ </View>
</View>
+ {primaryRestoreButton}
</View>
);
}
const unboundStyles = {
+ screenContainer: {
+ flex: 1,
+ },
container: {
flex: 1,
alignItems: 'center',
@@ -102,6 +120,10 @@
instructionsBold: {
fontWeight: 'bold',
},
+ primaryRestoreButton: {
+ alignItems: 'center',
+ marginBottom: 20,
+ },
};
export default QRCodeScreen;

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 22, 5:39 AM (16 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2533882
Default Alt Text
D13906.id45847.diff (6 KB)

Event Timeline