Page MenuHomePhabricator

D14085.id46262.diff
No OneTemporary

D14085.id46262.diff

diff --git a/native/account/prompt-button.react.js b/native/account/prompt-button.react.js
--- a/native/account/prompt-button.react.js
+++ b/native/account/prompt-button.react.js
@@ -48,7 +48,7 @@
backgroundColor: 'siweButton',
flexDirection: 'row',
justifyContent: 'center',
- padding: 12,
+ padding: 10,
},
siweIcon: {
paddingRight: 10,
diff --git a/native/account/restore-prompt-screen.react.js b/native/account/restore-prompt-screen.react.js
--- a/native/account/restore-prompt-screen.react.js
+++ b/native/account/restore-prompt-screen.react.js
@@ -8,6 +8,8 @@
import RegistrationContainer from './registration/registration-container.react.js';
import RegistrationContentContainer from './registration/registration-content-container.react.js';
import type { SignInNavigationProp } from './sign-in-navigator.react';
+import { useSIWEPanelState } from './siwe-hooks.js';
+import SIWEPanel from './siwe-panel.react.js';
import type { NavigationRoute } from '../navigation/route-names';
import { RestorePasswordAccountScreenRouteName } from '../navigation/route-names.js';
import { useStyles } from '../themes/colors.js';
@@ -18,6 +20,10 @@
+route: NavigationRoute<'RestorePromptScreen'>,
};
+const siweSignatureRequestData = {
+ messageType: 'msg_auth',
+};
+
function RestorePromptScreen(props: Props): React.Node {
const styles = useStyles(unboundStyles);
@@ -25,43 +31,67 @@
props.navigation.navigate(RestorePasswordAccountScreenRouteName);
}, [props.navigation]);
+ const {
+ panelState,
+ openPanel,
+ onPanelClosed,
+ onPanelClosing,
+ siwePanelSetLoading,
+ } = useSIWEPanelState();
+ let siwePanel;
+ if (panelState !== 'closed') {
+ siwePanel = (
+ <SIWEPanel
+ onClosing={onPanelClosing}
+ onClosed={onPanelClosed}
+ closing={panelState === 'closing'}
+ onSuccessfulWalletSignature={() => {}}
+ siweSignatureRequestData={siweSignatureRequestData}
+ setLoading={siwePanelSetLoading}
+ />
+ );
+ }
+
return (
- <RegistrationContainer>
- <RegistrationContentContainer style={styles.scrollViewContentContainer}>
- <Text style={styles.header}>Restore account</Text>
- <Text style={styles.section}>
- If you’ve lost access to your primary device, you can try recovering
- your Comm account.
- </Text>
- <Text style={styles.section}>
- To proceed, select the same login method that you used during
- registration.
- </Text>
- <Text style={styles.section}>
- Note that after completing the recovery flow, you will be logged out
- from all of your other devices.
- </Text>
- <View style={styles.iconContainer}>
- <RestoreIcon />
- </View>
- </RegistrationContentContainer>
- <RegistrationButtonContainer>
- <View style={styles.buttonContainer}>
- <PromptButton
- text="Restore with Ethereum"
- onPress={() => {}}
- variant="siwe"
- />
- </View>
- <View style={styles.buttonContainer}>
- <PromptButton
- text="Restore with password"
- onPress={openPasswordRestoreScreen}
- variant="enabled"
- />
- </View>
- </RegistrationButtonContainer>
- </RegistrationContainer>
+ <>
+ <RegistrationContainer>
+ <RegistrationContentContainer style={styles.scrollViewContentContainer}>
+ <Text style={styles.header}>Restore account</Text>
+ <Text style={styles.section}>
+ If you’ve lost access to your primary device, you can try recovering
+ your Comm account.
+ </Text>
+ <Text style={styles.section}>
+ To proceed, select the same login method that you used during
+ registration.
+ </Text>
+ <Text style={styles.section}>
+ Note that after completing the recovery flow, you will be logged out
+ from all of your other devices.
+ </Text>
+ <View style={styles.iconContainer}>
+ <RestoreIcon />
+ </View>
+ </RegistrationContentContainer>
+ <RegistrationButtonContainer>
+ <View style={styles.buttonContainer}>
+ <PromptButton
+ text="Restore with Ethereum"
+ onPress={openPanel}
+ variant={panelState === 'opening' ? 'loading' : 'siwe'}
+ />
+ </View>
+ <View style={styles.buttonContainer}>
+ <PromptButton
+ text="Restore with password"
+ onPress={openPasswordRestoreScreen}
+ variant="enabled"
+ />
+ </View>
+ </RegistrationButtonContainer>
+ </RegistrationContainer>
+ {siwePanel}
+ </>
);
}

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 12, 7:34 PM (19 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2649251
Default Alt Text
D14085.id46262.diff (4 KB)

Event Timeline