Page MenuHomePhabricator

D9892.diff
No OneTemporary

D9892.diff

diff --git a/web/app.react.js b/web/app.react.js
--- a/web/app.react.js
+++ b/web/app.react.js
@@ -66,6 +66,7 @@
import { createTunnelbrokerInitMessage } from './selectors/tunnelbroker-selectors.js';
import AccountSettings from './settings/account-settings.react.js';
import DangerZone from './settings/danger-zone.react.js';
+import KeyserverSelectionList from './settings/keyserver-selection-list.react.js';
import CommunityPicker from './sidebar/community-picker.react.js';
import Splash from './splash/splash.react.js';
import './typography.css';
@@ -292,7 +293,7 @@
if (settingsSection === 'account') {
mainContent = <AccountSettings />;
} else if (settingsSection === 'keyservers') {
- mainContent = null;
+ mainContent = <KeyserverSelectionList />;
} else if (settingsSection === 'danger-zone') {
mainContent = <DangerZone />;
}
diff --git a/web/settings/keyserver-selection-list.css b/web/settings/keyserver-selection-list.css
new file mode 100644
--- /dev/null
+++ b/web/settings/keyserver-selection-list.css
@@ -0,0 +1,12 @@
+.container {
+ flex: 1;
+ background-color: var(--panel-background-primary-default);
+ padding: 40px;
+}
+
+.header {
+ color: var(--text-background-primary-default);
+ font-weight: var(--semi-bold);
+ line-height: var(--line-height-display);
+ margin-bottom: 16px;
+}
diff --git a/web/settings/keyserver-selection-list.react.js b/web/settings/keyserver-selection-list.react.js
new file mode 100644
--- /dev/null
+++ b/web/settings/keyserver-selection-list.react.js
@@ -0,0 +1,43 @@
+// @flow
+
+import * as React from 'react';
+
+import { selectedKeyserversSelector } from 'lib/selectors/keyserver-selectors.js';
+import type { SelectedKeyserverInfo } from 'lib/types/keyserver-types.js';
+
+import KeyserverSelectionListItem from './keyserver-selection-list-item.react.js';
+import css from './keyserver-selection-list.css';
+import { useSelector } from '../redux/redux-utils.js';
+
+function KeyserverSelectionList(): React.Node {
+ const selectedKeyserverInfos: $ReadOnlyArray<SelectedKeyserverInfo> =
+ useSelector(selectedKeyserversSelector);
+
+ const selectedKeyservers = React.useMemo(
+ () =>
+ selectedKeyserverInfos.map(
+ ({ keyserverAdminUserInfo, keyserverInfo }) => (
+ <KeyserverSelectionListItem
+ key={`${keyserverAdminUserInfo.id}${keyserverInfo.urlPrefix}`}
+ keyserverAdminUserInfo={keyserverAdminUserInfo}
+ keyserverInfo={keyserverInfo}
+ />
+ ),
+ ),
+ [selectedKeyserverInfos],
+ );
+
+ const keyserverSelectionList = React.useMemo(
+ () => (
+ <div className={css.container}>
+ <h4 className={css.header}>Keyservers</h4>
+ {selectedKeyservers}
+ </div>
+ ),
+ [selectedKeyservers],
+ );
+
+ return keyserverSelectionList;
+}
+
+export default KeyserverSelectionList;

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 9, 4:46 AM (20 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2448692
Default Alt Text
D9892.diff (2 KB)

Event Timeline