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 @@ -140,6 +140,7 @@ export const UserProfileBottomSheetRouteName = 'UserProfileBottomSheet'; export const UserProfileAvatarModalRouteName = 'UserProfileAvatarModal'; export const KeyserverSelectionListRouteName = 'KeyserverSelectionList'; +export const AddKeyserverRouteName = 'AddKeyserver'; export type RootParamList = { +LoggedOutModal: void, @@ -234,6 +235,7 @@ +SecondaryDeviceQRCodeScanner: void, +BackupMenu: void, +KeyserverSelectionList: void, + +AddKeyserver: void, }; export type CommunityDrawerParamList = { +TabNavigator: void }; diff --git a/native/profile/add-keyserver.react.js b/native/profile/add-keyserver.react.js new file mode 100644 --- /dev/null +++ b/native/profile/add-keyserver.react.js @@ -0,0 +1,10 @@ +// @flow + +import * as React from 'react'; + +// eslint-disable-next-line no-unused-vars +function AddKeyserver(props: { ... }): React.Node { + return null; +} + +export default AddKeyserver; diff --git a/native/profile/keyserver-selection-list-header-right-button.react.js b/native/profile/keyserver-selection-list-header-right-button.react.js new file mode 100644 --- /dev/null +++ b/native/profile/keyserver-selection-list-header-right-button.react.js @@ -0,0 +1,20 @@ +// @flow + +import { useNavigation } from '@react-navigation/native'; +import * as React from 'react'; + +import HeaderRightAddButton from '../navigation/header-right-add-button.react.js'; +import { AddKeyserverRouteName } from '../navigation/route-names.js'; + +function KeyserverSelectionListHeaderRightButton(): React.Node { + const { navigate } = useNavigation(); + + const navigateToAddKeyserverScreen = React.useCallback( + () => navigate(AddKeyserverRouteName), + [navigate], + ); + + return ; +} + +export default KeyserverSelectionListHeaderRightButton; diff --git a/native/profile/profile.react.js b/native/profile/profile.react.js --- a/native/profile/profile.react.js +++ b/native/profile/profile.react.js @@ -9,6 +9,7 @@ import * as React from 'react'; import { View, useWindowDimensions } from 'react-native'; +import AddKeyserver from './add-keyserver.react.js'; import AppearancePreferences from './appearance-preferences.react.js'; import BackupMenu from './backup-menu.react.js'; import BuildInfo from './build-info.react.js'; @@ -17,6 +18,7 @@ import DevTools from './dev-tools.react.js'; import EditPassword from './edit-password.react.js'; import EmojiUserAvatarCreation from './emoji-user-avatar-creation.react.js'; +import KeyserverSelectionListHeaderRightButton from './keyserver-selection-list-header-right-button.react.js'; import KeyserverSelectionList from './keyserver-selection-list.react.js'; import LinkedDevicesHeaderRightButton from './linked-devices-header-right-button.react.js'; import LinkedDevices from './linked-devices.react.js'; @@ -45,6 +47,7 @@ SecondaryDeviceQRCodeScannerRouteName, BackupMenuRouteName, KeyserverSelectionListRouteName, + AddKeyserverRouteName, type ScreenParamList, type ProfileParamList, } from '../navigation/route-names.js'; @@ -63,7 +66,12 @@ // eslint-disable-next-line react/display-name headerRight: () => , }; -const keyserverSelectionListOptions = { headerTitle: 'Keyserver selection' }; +const keyserverSelectionListOptions = { + headerTitle: 'Keyserver selection', + // eslint-disable-next-line react/display-name + headerRight: () => , +}; +const addKeyserverOptions = { headerTitle: 'Add keyserver' }; const backupMenuOptions = { headerTitle: 'Backup menu' }; const secondaryDeviceQRCodeScannerOptions = { headerTitle: '', @@ -159,6 +167,11 @@ component={KeyserverSelectionList} options={keyserverSelectionListOptions} /> +