Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3389315
D9587.id32374.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D9587.id32374.diff
View Options
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,22 @@
+// @flow
+
+import { useNavigation } from '@react-navigation/native';
+import * as React from 'react';
+
+import HeaderRightTextButton from '../navigation/header-right-text-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 (
+ <HeaderRightTextButton label="Add" onPress={navigateToAddKeyserverScreen} />
+ );
+}
+
+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: () => <LinkedDevicesHeaderRightButton />,
};
-const keyserverSelectionListOptions = { headerTitle: 'Keyserver selection' };
+const keyserverSelectionListOptions = {
+ headerTitle: 'Keyserver selection',
+ // eslint-disable-next-line react/display-name
+ headerRight: () => <KeyserverSelectionListHeaderRightButton />,
+};
+const addKeyserverOptions = { headerTitle: 'Add keyserver' };
const backupMenuOptions = { headerTitle: 'Backup menu' };
const secondaryDeviceQRCodeScannerOptions = {
headerTitle: '',
@@ -159,6 +167,11 @@
component={KeyserverSelectionList}
options={keyserverSelectionListOptions}
/>
+ <Profile.Screen
+ name={AddKeyserverRouteName}
+ component={AddKeyserver}
+ options={addKeyserverOptions}
+ />
<Profile.Screen
name={BackupMenuRouteName}
component={BackupMenu}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 30, 6:33 PM (14 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2601954
Default Alt Text
D9587.id32374.diff (4 KB)
Attached To
Mode
D9587: [native] introduce KeyserverSelectionListAddButton
Attached
Detach File
Event Timeline
Log In to Comment