Page MenuHomePhabricator

D13906.id45836.diff
No OneTemporary

D13906.id45836.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
@@ -434,11 +434,6 @@
combinedSetMode('log-in');
}, [combinedSetMode]);
- const onPressRestore = React.useCallback(
- () => combinedSetMode('restore'),
- [combinedSetMode],
- );
-
const { navigate } = props.navigation;
const onPressQRCodeSignIn = React.useCallback(() => {
navigate(QRCodeSignInNavigatorRouteName);
@@ -522,6 +517,7 @@
);
}
if (__DEV__ || usingRestoreFlow) {
+ const buttonText = usingRestoreFlow ? 'Sign in' : 'Sign in (QR)';
signInButtons.push(
<TouchableOpacity
onPress={onPressQRCodeSignIn}
@@ -529,7 +525,7 @@
activeOpacity={0.6}
key="qr-code-login"
>
- <Text style={classicAuthButtonTextStyle}>Sign in (QR)</Text>
+ <Text style={classicAuthButtonTextStyle}>{buttonText}</Text>
</TouchableOpacity>,
);
}
@@ -557,25 +553,10 @@
);
}
- let restoreButton = null;
- if (usingRestoreFlow) {
- restoreButton = (
- <TouchableOpacity
- onPress={onPressRestore}
- style={classicAuthButtonStyle}
- activeOpacity={0.6}
- key="qr-code-login"
- >
- <Text style={classicAuthButtonTextStyle}>Restore</Text>
- </TouchableOpacity>
- );
- }
-
return (
<AnimatedView style={buttonsViewStyle}>
<LoggedOutStaffInfo />
{siweSection}
- {restoreButton}
<View style={styles.signInButtons}>{signInButtons}</View>
<View style={styles.registerButtons}>
<TouchableOpacity
@@ -594,7 +575,6 @@
onPressNewRegister,
onPressLogIn,
onPressQRCodeSignIn,
- onPressRestore,
onPressSIWE,
classicAuthButtonStyle,
classicAuthButtonTextStyle,
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 your 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
Thu, Nov 21, 4:35 PM (12 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2556640
Default Alt Text
D13906.id45836.diff (5 KB)

Event Timeline