Page MenuHomePhabricator

D14149.id46384.diff
No OneTemporary

D14149.id46384.diff

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}
/>
+ <QRAuthStack.Screen
+ name={SecondaryDeviceConnectedRouteName}
+ component={SecondaryDeviceConnected}
+ options={disableGesturesScreenOptions}
+ />
</QRAuthStack.Navigator>
</QRAuthContextProvider>
);
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,73 @@
+// @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 (
+ <RegistrationContainer>
+ <RegistrationContentContainer>
+ <Text style={styles.header}>Device added</Text>
+ <Text style={styles.body}>Device registered successfully</Text>
+ </RegistrationContentContainer>
+ <RegistrationButtonContainer>
+ <PrimaryButton onPress={onPress} label="OK" variant="enabled" />
+ </RegistrationButtonContainer>
+ </RegistrationContainer>
+ );
+}
+
+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
@@ -182,6 +182,7 @@
export const QRAuthNavigatorRouteName = 'QRAuthNavigator';
export const QRAuthNotPrimaryDeviceRouteName = 'QRAuthNotPrimaryDevice';
export const ConnectSecondaryDeviceRouteName = 'ConnectSecondaryDevice';
+export const SecondaryDeviceConnectedRouteName = 'SecondaryDeviceConnected';
export type RootParamList = {
+LoggedOutModal: void,
@@ -360,6 +361,7 @@
+ConnectSecondaryDevice: {
+data: string,
},
+ +SecondaryDeviceConnected: void,
};
export type ScreenParamList = {

File Metadata

Mime Type
text/plain
Expires
Thu, Jan 9, 8:04 AM (1 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2830575
Default Alt Text
D14149.id46384.diff (4 KB)

Event Timeline