-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[web] introduce keyserver selection modal
Summary: This diff introduces the barebones keyserver selection modal. The focus of this diff is just to implement the interface. Subsequent diffs will handle the behavior of disconnect/removing a keyserver from your keyserver selection list Figma: {F882258} Linear task: https://linear.app/comm/issue/ENG-5497/introduce-remove-keyserver-ui Depends on D9918 Test Plan: Please see the demo video below {F882263} Reviewers: inka, rohan, michal Reviewed By: inka Subscribers: ashoat, tomek Differential Revision: https://phab.comm.dev/D9920
- Loading branch information
Showing
3 changed files
with
118 additions
and
2 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
web/modals/keyserver-selection/keyserver-selection-modal.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
.container { | ||
padding: 0 32px; | ||
} | ||
|
||
.keyserverDetailsContainer { | ||
background-color: var(--modal-background-secondary-default); | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
row-gap: 8px; | ||
padding: 16px 0; | ||
border-radius: 8px; | ||
margin-top: 16px; | ||
} | ||
|
||
.keyserverDetailsHeaderContainer { | ||
display: flex; | ||
align-items: center; | ||
column-gap: 8px; | ||
} | ||
|
||
.keyserverURL { | ||
color: var(--text-background-primary-default); | ||
} | ||
|
||
.keyserverRemoveTextContainer { | ||
color: var(--text-background-primary-default); | ||
margin: 16px 0 24px; | ||
display: flex; | ||
flex-direction: column; | ||
row-gap: 24px; | ||
} | ||
|
||
.buttonContainer { | ||
background-color: var(--modal-background-secondary-default); | ||
padding: 16px 32px; | ||
} | ||
|
||
.button { | ||
width: 100%; | ||
} |
62 changes: 62 additions & 0 deletions
62
web/modals/keyserver-selection/keyserver-selection-modal.react.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// @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 Modal from '../modal.react.js'; | ||
|
||
type Props = { | ||
+keyserverAdminUserInfo: GlobalAccountUserInfo, | ||
+keyserverInfo: KeyserverInfo, | ||
}; | ||
|
||
function KeyserverSelectionModal(props: Props): React.Node { | ||
const { keyserverAdminUserInfo, keyserverInfo } = props; | ||
|
||
const { popModal } = useModalContext(); | ||
|
||
return ( | ||
<Modal size="large" onClose={popModal} name="Keyserver details"> | ||
<div className={css.container}> | ||
<div className={css.keyserverDetailsContainer}> | ||
<div className={css.keyserverDetailsHeaderContainer}> | ||
<KeyserverPill | ||
keyserverAdminUsername={keyserverAdminUserInfo.username} | ||
/> | ||
<StatusIndicator connectionInfo={keyserverInfo.connection} /> | ||
</div> | ||
<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> | ||
</div> | ||
</div> | ||
<div className={css.buttonContainer}> | ||
<Button | ||
variant="filled" | ||
buttonColor={buttonThemes.danger} | ||
className={css.button} | ||
> | ||
Delete keyserver from list | ||
</Button> | ||
</div> | ||
</Modal> | ||
); | ||
} | ||
|
||
export default KeyserverSelectionModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters