Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3485147
D14159.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D14159.diff
View Options
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
@@ -1,6 +1,7 @@
// @flow
import type {
+ StackHeaderLeftButtonProps,
StackNavigationHelpers,
StackNavigationProp,
} from '@react-navigation/core';
@@ -13,6 +14,7 @@
import SecondaryDeviceConnected from './secondary-device-connected.react.js';
import SecondaryDeviceNotResponding from './secondary-device-not-responding.react.js';
import SecondaryDeviceQRCodeScanner from './secondary-device-qr-code-scanner.react.js';
+import HeaderCloseLeftButton from '../../navigation/header-close-left-button.react.js';
import type { RootNavigationProp } from '../../navigation/root-navigator.react.js';
import {
ConnectSecondaryDeviceRouteName,
@@ -51,9 +53,18 @@
},
gestureEnabled: true,
};
+const headerCloseLeftButtonStyle = {
+ paddingLeft: 10,
+};
const secondaryDeviceQRCodeScannerOptions = {
headerTitle: deviceIsEmulator ? 'Link device' : '',
headerBackTitleVisible: false,
+ headerLeft: (headerLeftProps: StackHeaderLeftButtonProps) => (
+ <HeaderCloseLeftButton
+ style={headerCloseLeftButtonStyle}
+ onPress={headerLeftProps.onPress}
+ />
+ ),
};
const disableGesturesScreenOptions = {
headerLeft: null,
diff --git a/native/navigation/header-close-left-button.react.js b/native/navigation/header-close-left-button.react.js
new file mode 100644
--- /dev/null
+++ b/native/navigation/header-close-left-button.react.js
@@ -0,0 +1,34 @@
+// @flow
+
+import * as React from 'react';
+import { Text } from 'react-native';
+import { TouchableOpacity } from 'react-native-gesture-handler';
+
+import { useStyles } from '../themes/colors.js';
+import type { ViewStyle } from '../types/styles.js';
+
+type HeaderCloseLeftButtonProps = {
+ +onPress?: () => mixed,
+ +style?: ViewStyle,
+};
+function HeaderCloseLeftButton(props: HeaderCloseLeftButtonProps): React.Node {
+ const { onPress, style } = props;
+ const styles = useStyles(unboundStyles);
+ return (
+ <TouchableOpacity style={style} onPress={onPress}>
+ <Text style={styles.closeIcon}>×</Text>
+ </TouchableOpacity>
+ );
+}
+
+const unboundStyles = {
+ closeIcon: {
+ color: 'white',
+ fontSize: 36,
+ textShadowColor: 'black',
+ textShadowOffset: { width: 0, height: 1 },
+ textShadowRadius: 1,
+ },
+};
+
+export default HeaderCloseLeftButton;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 18, 6:48 PM (14 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2674501
Default Alt Text
D14159.diff (2 KB)
Attached To
Mode
D14159: [native] replace back button with close button on the scanning QR code screen
Attached
Detach File
Event Timeline
Log In to Comment