From a5d69348e54dfe77cddb07d0d64ca2fe867876ec Mon Sep 17 00:00:00 2001 From: Ginsu Eddy Date: Tue, 24 Oct 2023 16:30:32 -0400 Subject: [PATCH] [native] introduce barebones keyserver selection list screen Summary: This diff introduces the barebones keyserver selection list screen and all the navigation logic to navigate from the profile screen to this new screen Linear Task: https://linear.app/comm/issue/ENG-4911/introduce-keyserver-selection-screen-into-our-profile-app-navigation Depends on D9565 Test Plan: Please see the demo video below {F834123} Reviewers: rohan, inka, michal Reviewed By: rohan Subscribers: ashoat, tomek, wyilio Differential Revision: https://phab.comm.dev/D9566 --- native/navigation/route-names.js | 2 ++ native/profile/keyserver-selection-list.react.js | 10 ++++++++++ native/profile/profile-screen.react.js | 3 ++- native/profile/profile.react.js | 8 ++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 native/profile/keyserver-selection-list.react.js diff --git a/native/navigation/route-names.js b/native/navigation/route-names.js index 3c291e3cda..a74ba87907 100644 --- a/native/navigation/route-names.js +++ b/native/navigation/route-names.js @@ -139,6 +139,7 @@ export const UserProfileBottomSheetNavigatorRouteName = 'UserProfileBottomSheetNavigator'; export const UserProfileBottomSheetRouteName = 'UserProfileBottomSheet'; export const UserProfileAvatarModalRouteName = 'UserProfileAvatarModal'; +export const KeyserverSelectionListRouteName = 'KeyserverSelectionList'; export type RootParamList = { +LoggedOutModal: void, @@ -232,6 +233,7 @@ export type ProfileParamList = { +LinkedDevices: void, +SecondaryDeviceQRCodeScanner: void, +BackupMenu: void, + +KeyserverSelectionList: void, }; export type CommunityDrawerParamList = { +TabNavigator: void }; diff --git a/native/profile/keyserver-selection-list.react.js b/native/profile/keyserver-selection-list.react.js new file mode 100644 index 0000000000..edda755e6e --- /dev/null +++ b/native/profile/keyserver-selection-list.react.js @@ -0,0 +1,10 @@ +// @flow + +import * as React from 'react'; + +// eslint-disable-next-line no-unused-vars +function KeyserverSelectionList(props: { ... }): React.Node { + return null; +} + +export default KeyserverSelectionList; diff --git a/native/profile/profile-screen.react.js b/native/profile/profile-screen.react.js index ab0d1c4851..378b3da5b2 100644 --- a/native/profile/profile-screen.react.js +++ b/native/profile/profile-screen.react.js @@ -37,6 +37,7 @@ import { DefaultNotificationsPreferencesRouteName, LinkedDevicesRouteName, BackupMenuRouteName, + KeyserverSelectionListRouteName, } from '../navigation/route-names.js'; import { useSelector } from '../redux/redux-utils.js'; import { type Colors, useColors, useStyles } from '../themes/colors.js'; @@ -324,7 +325,7 @@ class ProfileScreen extends React.PureComponent { }; onPressKeyserverSelection = () => { - // TODO + this.navigateIfActive(KeyserverSelectionListRouteName); }; } diff --git a/native/profile/profile.react.js b/native/profile/profile.react.js index b76be38d7e..a2f77d58b5 100644 --- a/native/profile/profile.react.js +++ b/native/profile/profile.react.js @@ -17,6 +17,7 @@ import DeleteAccount from './delete-account.react.js'; import DevTools from './dev-tools.react.js'; import EditPassword from './edit-password.react.js'; import EmojiUserAvatarCreation from './emoji-user-avatar-creation.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'; import PrivacyPreferences from './privacy-preferences.react.js'; @@ -43,6 +44,7 @@ import { LinkedDevicesRouteName, SecondaryDeviceQRCodeScannerRouteName, BackupMenuRouteName, + KeyserverSelectionListRouteName, type ScreenParamList, type ProfileParamList, } from '../navigation/route-names.js'; @@ -61,6 +63,7 @@ const linkedDevicesOptions = { // eslint-disable-next-line react/display-name headerRight: () => , }; +const keyserverSelectionListOptions = { headerTitle: 'Keyserver selection' }; const backupMenuOptions = { headerTitle: 'Backup menu' }; const secondaryDeviceQRCodeScannerOptions = { headerTitle: '', @@ -151,6 +154,11 @@ function ProfileComponent(props: Props): React.Node { component={LinkedDevices} options={linkedDevicesOptions} /> +