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 @@ -458,7 +458,7 @@ , ); @@ -469,7 +469,7 @@ , ); @@ -514,7 +514,7 @@ ); 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 @@ -10,31 +10,31 @@ type Props = { +text: string, +onPress: () => mixed, - +variant: 'regular' | 'siwe', + +variant: 'enabled' | 'disabled' | 'loading' | 'siwe', }; function PromptButton(props: Props): React.Node { const styles = useStyles(unboundStyles); const { text, onPress, variant } = props; - if (variant === 'regular') { + if (variant === 'siwe') { return ( - + + + + + {text} + + + ); + } else { + return ( + + ); } - - return ( - - - - - - {text} - - - ); } const unboundStyles = { diff --git a/native/account/restore-password-account-screen.react.js b/native/account/restore-password-account-screen.react.js new file mode 100644 --- /dev/null +++ b/native/account/restore-password-account-screen.react.js @@ -0,0 +1,92 @@ +// @flow + +import * as React from 'react'; +import { Text, TextInput, View } from 'react-native'; + +import PromptButton from './prompt-button.react.js'; +import RegistrationButtonContainer from './registration/registration-button-container.react.js'; +import RegistrationContainer from './registration/registration-container.react.js'; +import RegistrationContentContainer from './registration/registration-content-container.react.js'; +import RegistrationTextInput from './registration/registration-text-input.react.js'; +import type { SignInNavigationProp } from './sign-in-navigator.react.js'; +import type { NavigationRoute } from '../navigation/route-names.js'; +import { useStyles } from '../themes/colors.js'; + +type Props = { + +navigation: SignInNavigationProp<'RestorePasswordAccountScreen'>, + +route: NavigationRoute<'RestorePasswordAccountScreen'>, +}; + +// eslint-disable-next-line no-unused-vars +function RestorePasswordAccountScreen(props: Props): React.Node { + const [username, setUsername] = React.useState(''); + const [password, setPassword] = React.useState(''); + + const passwordInputRef = React.useRef>(); + const focusPasswordInput = React.useCallback(() => { + passwordInputRef.current?.focus(); + }, []); + + const areCredentialsPresent = !!username && !!password; + const onProceed = React.useCallback(() => {}, []); + + const styles = useStyles(unboundStyles); + return ( + + + Restore with password + + + + + + + + + + ); +} + +const unboundStyles = { + header: { + fontSize: 24, + color: 'panelForegroundLabel', + paddingBottom: 16, + }, + buttonContainer: { + flexDirection: 'row', + }, + password: { + marginTop: 16, + }, +}; + +export default RestorePasswordAccountScreen; 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 @@ -10,6 +10,7 @@ import RegistrationContentContainer from './registration/registration-content-container.react.js'; import type { SignInNavigationProp } from './sign-in-navigator.react'; import type { NavigationRoute } from '../navigation/route-names'; +import { RestorePasswordAccountScreenRouteName } from '../navigation/route-names.js'; import { useStyles } from '../themes/colors.js'; type Props = { @@ -17,10 +18,13 @@ +route: NavigationRoute<'RestorePromptScreen'>, }; -// eslint-disable-next-line no-unused-vars function RestorePromptScreen(props: Props): React.Node { const styles = useStyles(unboundStyles); + const openPasswordRestoreScreen = React.useCallback(() => { + props.navigation.navigate(RestorePasswordAccountScreenRouteName); + }, [props.navigation]); + return ( @@ -52,8 +56,8 @@ {}} - variant="regular" + onPress={openPasswordRestoreScreen} + variant="enabled" /> diff --git a/native/account/sign-in-navigator.react.js b/native/account/sign-in-navigator.react.js --- a/native/account/sign-in-navigator.react.js +++ b/native/account/sign-in-navigator.react.js @@ -8,6 +8,7 @@ import * as React from 'react'; import QRCodeScreen from './qr-code-screen.react.js'; +import RestorePasswordAccountScreen from './restore-password-account-screen.react.js'; import RestorePromptScreen from './restore-prompt-screen.react.js'; import type { RootNavigationProp } from '../navigation/root-navigator.react.js'; import { @@ -15,6 +16,7 @@ type SignInParamList, QRCodeScreenRouteName, RestorePromptScreenRouteName, + RestorePasswordAccountScreenRouteName, } from '../navigation/route-names.js'; import { useColors } from '../themes/colors.js'; @@ -59,6 +61,10 @@ name={RestorePromptScreenRouteName} component={RestorePromptScreen} /> + ); } diff --git a/native/navigation/route-names.js b/native/navigation/route-names.js --- a/native/navigation/route-names.js +++ b/native/navigation/route-names.js @@ -152,6 +152,8 @@ export const SignInNavigatorRouteName = 'SignInNavigator'; export const QRCodeScreenRouteName = 'QRCodeScreen'; export const RestorePromptScreenRouteName = 'RestorePromptScreen'; +export const RestorePasswordAccountScreenRouteName = + 'RestorePasswordAccountScreen'; export const UserProfileBottomSheetNavigatorRouteName = 'UserProfileBottomSheetNavigator'; export const UserProfileBottomSheetRouteName = 'UserProfileBottomSheet'; @@ -337,6 +339,7 @@ export type SignInParamList = { +QRCodeScreen: void, +RestorePromptScreen: void, + +RestorePasswordAccountScreen: void, }; export type UserProfileBottomSheetParamList = {