diff --git a/native/account/qr-auth/qr-auth-navigator.react.js b/native/account/qr-auth/qr-auth-navigator.react.js --- a/native/account/qr-auth/qr-auth-navigator.react.js +++ b/native/account/qr-auth/qr-auth-navigator.react.js @@ -10,6 +10,7 @@ import ConnectSecondaryDevice from './connect-secondary-device.react.js'; import { QRAuthContextProvider } from './qr-auth-context-provider.js'; import QRAuthNotPrimaryDevice from './qr-auth-not-primary-device.react.js'; +import SecondaryDeviceConnected from './secondary-device-connected.react.js'; import SecondaryDeviceQRCodeScanner from './secondary-device-qr-code-scanner.react.js'; import type { RootNavigationProp } from '../../navigation/root-navigator.react.js'; import { @@ -18,6 +19,7 @@ type QRAuthNavigatorParamList, QRAuthNotPrimaryDeviceRouteName, type ScreenParamList, + SecondaryDeviceConnectedRouteName, SecondaryDeviceQRCodeScannerRouteName, } from '../../navigation/route-names.js'; import { deviceIsEmulator } from '../../utils/url-utils.js'; @@ -51,6 +53,10 @@ headerTitle: deviceIsEmulator ? 'Link device' : '', headerBackTitleVisible: false, }; +const disableGesturesScreenOptions = { + headerLeft: null, + gestureEnabled: false, +}; // eslint-disable-next-line no-unused-vars function QRAuthNavigator(props: Props): React.Node { @@ -70,6 +76,11 @@ name={ConnectSecondaryDeviceRouteName} component={ConnectSecondaryDevice} /> + ); diff --git a/native/account/qr-auth/secondary-device-connected.react.js b/native/account/qr-auth/secondary-device-connected.react.js new file mode 100644 --- /dev/null +++ b/native/account/qr-auth/secondary-device-connected.react.js @@ -0,0 +1,75 @@ +// @flow + +import type { + StackNavigationEventMap, + StackNavigationState, + StackOptions, +} from '@react-navigation/core'; +import * as React from 'react'; +import { Text } from 'react-native'; + +import type { QRAuthNavigationProp } from './qr-auth-navigator.react.js'; +import RegistrationButtonContainer from '../../account/registration/registration-button-container.react.js'; +import RegistrationContainer from '../../account/registration/registration-container.react.js'; +import RegistrationContentContainer from '../../account/registration/registration-content-container.react.js'; +import PrimaryButton from '../../components/primary-button.react.js'; +import type { RootNavigationProp } from '../../navigation/root-navigator.react.js'; +import { + type NavigationRoute, + type ScreenParamList, +} from '../../navigation/route-names.js'; +import { useStyles } from '../../themes/colors.js'; + +type Props = { + +navigation: QRAuthNavigationProp<'SecondaryDeviceConnected'>, + +route: NavigationRoute<'SecondaryDeviceConnected'>, +}; + +function SecondaryDeviceConnected(prop: Props): React.Node { + const { navigation } = prop; + const styles = useStyles(unboundStyles); + + const onPress = React.useCallback(() => { + navigation + .getParent< + ScreenParamList, + 'LinkedDevicesBottomSheet', + StackNavigationState, + StackOptions, + StackNavigationEventMap, + RootNavigationProp<'LinkedDevicesBottomSheet'>, + >() + ?.goBack(); + }, [navigation]); + + return ( + + + Device added + + Your new device has been successfully registered! + + + + + + + ); +} + +const unboundStyles = { + header: { + fontSize: 24, + color: 'panelForegroundLabel', + paddingBottom: 16, + }, + body: { + fontFamily: 'Arial', + fontSize: 15, + lineHeight: 20, + color: 'panelForegroundSecondaryLabel', + paddingBottom: 16, + }, +}; + +export default SecondaryDeviceConnected; 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 @@ -183,6 +183,7 @@ export const QRAuthNavigatorRouteName = 'QRAuthNavigator'; export const QRAuthNotPrimaryDeviceRouteName = 'QRAuthNotPrimaryDevice'; export const ConnectSecondaryDeviceRouteName = 'ConnectSecondaryDevice'; +export const SecondaryDeviceConnectedRouteName = 'SecondaryDeviceConnected'; export type RootParamList = { +LoggedOutModal: void, @@ -359,6 +360,7 @@ +SecondaryDeviceQRCodeScanner: void, +QRAuthNotPrimaryDevice: void, +ConnectSecondaryDevice: ConnectSecondaryDeviceParams, + +SecondaryDeviceConnected: void, }; export type ScreenParamList = {