diff --git a/native/account/qr-auth/qr-auth-navigator.react.js b/native/account/qr-auth/qr-auth-navigator.react.js index f1e2d6c4b..ff5930905 100644 --- a/native/account/qr-auth/qr-auth-navigator.react.js +++ b/native/account/qr-auth/qr-auth-navigator.react.js @@ -1,96 +1,107 @@ // @flow import type { + StackHeaderLeftButtonProps, StackNavigationHelpers, StackNavigationProp, } from '@react-navigation/core'; import { createStackNavigator } from '@react-navigation/stack'; import * as React from 'react'; 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 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, type NavigationRoute, type QRAuthNavigatorParamList, QRAuthNotPrimaryDeviceRouteName, type ScreenParamList, SecondaryDeviceConnectedRouteName, SecondaryDeviceNotRespondingRouteName, SecondaryDeviceQRCodeScannerRouteName, } from '../../navigation/route-names.js'; import { deviceIsEmulator } from '../../utils/url-utils.js'; export type QRAuthNavigationProp> = StackNavigationProp; const QRAuthStack = createStackNavigator< ScreenParamList, QRAuthNavigatorParamList, StackNavigationHelpers, >(); type Props = { +navigation: RootNavigationProp<'QRAuthNavigator'>, +route: NavigationRoute<'QRAuthNavigator'>, }; const screenOptions = { headerShown: true, headerTransparent: true, headerBackTitleVisible: false, headerTitle: '', headerTintColor: 'white', headerLeftContainerStyle: { paddingLeft: 12, }, gestureEnabled: true, }; +const headerCloseLeftButtonStyle = { + paddingLeft: 10, +}; const secondaryDeviceQRCodeScannerOptions = { headerTitle: deviceIsEmulator ? 'Link device' : '', headerBackTitleVisible: false, + headerLeft: (headerLeftProps: StackHeaderLeftButtonProps) => ( + + ), }; const disableGesturesScreenOptions = { headerLeft: null, gestureEnabled: false, }; // eslint-disable-next-line no-unused-vars function QRAuthNavigator(props: Props): React.Node { return ( ); } export default QRAuthNavigator; diff --git a/native/navigation/header-close-left-button.react.js b/native/navigation/header-close-left-button.react.js new file mode 100644 index 000000000..814773b95 --- /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 ( + + × + + ); +} + +const unboundStyles = { + closeIcon: { + color: 'white', + fontSize: 36, + textShadowColor: 'black', + textShadowOffset: { width: 0, height: 1 }, + textShadowRadius: 1, + }, +}; + +export default HeaderCloseLeftButton;