diff --git a/web/modals/keyserver-selection/keyserver-selection-modal.react.js b/web/modals/keyserver-selection/keyserver-selection-modal.react.js index 5b4dcb7bc..fae3f3dc0 100644 --- a/web/modals/keyserver-selection/keyserver-selection-modal.react.js +++ b/web/modals/keyserver-selection/keyserver-selection-modal.react.js @@ -1,107 +1,122 @@ // @flow import * as React from 'react'; import { useModalContext } from 'lib/components/modal-provider.react.js'; import type { KeyserverInfo } from 'lib/types/keyserver-types.js'; import type { GlobalAccountUserInfo } from 'lib/types/user-types.js'; import css from './keyserver-selection-modal.css'; import Button, { buttonThemes } from '../../components/button.react.js'; import KeyserverPill from '../../components/keyserver-pill.react.js'; import StatusIndicator from '../../components/status-indicator.react.js'; +import Alert from '../alert.react.js'; import Modal from '../modal.react.js'; type Props = { +keyserverAdminUserInfo: GlobalAccountUserInfo, +keyserverInfo: KeyserverInfo, }; function KeyserverSelectionModal(props: Props): React.Node { const { keyserverAdminUserInfo, keyserverInfo } = props; - const { popModal } = useModalContext(); + const { popModal, pushModal } = useModalContext(); + + const onClickDisconnectKeyserver = React.useCallback( + () => + // TODO: update this function when we have a way to + // disconnect from a keyserver + pushModal( + + Disconnecting from a keyserver is still not ready. Please come back + later. + , + ), + [pushModal], + ); const { keyerverRemoveInfoText, keyserverRemoveButton } = React.useMemo(() => { if (keyserverInfo.connection.status !== 'connected') { const removeInfoText = ( <>
You may delete an offline keyserver from your keyserver list. When you delete a keyserver, you will still remain in the associated communities.
Any messages or content you have previously sent will remain on the keyserver’s communities after disconnecting or deleting.
); const removeButton = ( ); return { keyerverRemoveInfoText: removeInfoText, keyserverRemoveButton: removeButton, }; } const removeInfoText = ( <>
Disconnecting from this keyserver will remove you from its associated communities.
Any messages or content you have previously sent will remain on the keyserver.
); const removeButton = ( ); return { keyerverRemoveInfoText: removeInfoText, keyserverRemoveButton: removeButton, }; - }, [keyserverInfo.connection.status]); + }, [keyserverInfo.connection.status, onClickDisconnectKeyserver]); return (
{keyserverInfo.urlPrefix}
{keyerverRemoveInfoText}
{keyserverRemoveButton}
); } export default KeyserverSelectionModal;