Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3348298
D10079.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D10079.diff
View Options
diff --git a/web/modals/keyserver-selection/keyserver-selection-modal.react.js b/web/modals/keyserver-selection/keyserver-selection-modal.react.js
--- a/web/modals/keyserver-selection/keyserver-selection-modal.react.js
+++ b/web/modals/keyserver-selection/keyserver-selection-modal.react.js
@@ -22,6 +22,67 @@
const { popModal } = useModalContext();
+ const { keyerverRemoveInfoText, keyserverRemoveButton } =
+ React.useMemo(() => {
+ if (keyserverInfo.connection.status !== 'connected') {
+ const removeInfoText = (
+ <>
+ <div>
+ You may delete an offline keyserver from your keyserver list. When
+ you delete a keyserver, you will still remain in the associated
+ communities.
+ </div>
+ <div>
+ Any messages or content you have previously sent will remain on
+ the keyserver’s communities after disconnecting or deleting.
+ </div>
+ </>
+ );
+
+ const removeButton = (
+ <Button
+ variant="filled"
+ buttonColor={buttonThemes.danger}
+ className={css.button}
+ >
+ Delete keyserver from list
+ </Button>
+ );
+
+ return {
+ keyerverRemoveInfoText: removeInfoText,
+ keyserverRemoveButton: removeButton,
+ };
+ }
+ const removeInfoText = (
+ <>
+ <div>
+ Disconnecting from this keyserver will remove you from its
+ associated communities.
+ </div>
+ <div>
+ Any messages or content you have previously sent will remain on the
+ keyserver.
+ </div>
+ </>
+ );
+
+ const removeButton = (
+ <Button
+ variant="filled"
+ buttonColor={buttonThemes.danger}
+ className={css.button}
+ >
+ Disconnect keyserver
+ </Button>
+ );
+
+ return {
+ keyerverRemoveInfoText: removeInfoText,
+ keyserverRemoveButton: removeButton,
+ };
+ }, [keyserverInfo.connection.status]);
+
return (
<Modal size="large" onClose={popModal} name="Keyserver details">
<div className={css.container}>
@@ -35,26 +96,10 @@
<div className={css.keyserverURL}>{keyserverInfo.urlPrefix}</div>
</div>
<div className={css.keyserverRemoveTextContainer}>
- <div>
- You may delete offline keyserver from your keyserver list. When you
- delete a keyserver, you will still remain in the associated
- communities.
- </div>
- <div>
- Any messages or content you have previously sent will remain on the
- keyserver’s communities after disconnecting or deleting.
- </div>
+ {keyerverRemoveInfoText}
</div>
</div>
- <div className={css.buttonContainer}>
- <Button
- variant="filled"
- buttonColor={buttonThemes.danger}
- className={css.button}
- >
- Delete keyserver from list
- </Button>
- </div>
+ <div className={css.buttonContainer}>{keyserverRemoveButton}</div>
</Modal>
);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 2:22 PM (19 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2571139
Default Alt Text
D10079.diff (3 KB)
Attached To
Mode
D10079: [web] update the keyserver selection modal based on the connection status
Attached
Detach File
Event Timeline
Log In to Comment