-
Notifications
You must be signed in to change notification settings - Fork 456
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: recovery email settings structure
- Loading branch information
Showing
4 changed files
with
215 additions
and
2 deletions.
There are no files selected for viewing
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,48 @@ | ||
import { | ||
Button, | ||
Dialog, | ||
DialogActions, | ||
DialogContent, | ||
DialogContentText, | ||
DialogTitle, | ||
IconButton, | ||
TextField, | ||
} from '@mui/material' | ||
import type { ReactElement } from 'react' | ||
|
||
import CloseIcon from '@/public/images/common/close.svg' | ||
|
||
import css from './styles.module.css' | ||
|
||
export default function AddEmailDialog({ open, onClose }: { open: boolean; onClose: () => void }): ReactElement { | ||
const onConfirm = () => { | ||
// TODO: Implement | ||
onClose() | ||
} | ||
|
||
return ( | ||
<Dialog open={open} onClose={onClose} className={css.dialog}> | ||
<DialogTitle className={css.title}> | ||
Add email address | ||
<IconButton onClick={onClose} className={css.close}> | ||
<CloseIcon /> | ||
</IconButton> | ||
</DialogTitle> | ||
|
||
<DialogContent dividers className={css.content}> | ||
<DialogContentText color="text.primary" mb={3}> | ||
You will need to sign a message to verify that you are the owner of this Safe Account. | ||
</DialogContentText> | ||
|
||
<TextField type="email" label="Email address" variant="outlined" fullWidth InputLabelProps={{ shrink: true }} /> | ||
</DialogContent> | ||
|
||
<DialogActions className={css.actions}> | ||
<Button onClick={onClose}>Cancel</Button> | ||
<Button variant="contained" onClick={onConfirm}> | ||
Continue | ||
</Button> | ||
</DialogActions> | ||
</Dialog> | ||
) | ||
} |
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,89 @@ | ||
import { Button, Grid, Paper, SvgIcon, Typography } from '@mui/material' | ||
import { VisibilityOutlined } from '@mui/icons-material' | ||
import { useState } from 'react' | ||
import type { ReactElement } from 'react' | ||
|
||
import ExternalLink from '@/components/common/ExternalLink' | ||
import AddEmailDialog from './AddEmailDialog' | ||
import EditIcon from '@/public/images/common/edit.svg' | ||
|
||
import css from './styles.module.css' | ||
|
||
export function RecoveryEmail(): ReactElement { | ||
const [addEmail, setAddEmail] = useState(false) | ||
|
||
const onAdd = () => { | ||
setAddEmail(true) | ||
} | ||
|
||
const onReveal = () => { | ||
// TODO: Implement | ||
} | ||
|
||
const onChange = () => {} | ||
|
||
const onClose = () => {} | ||
|
||
const randomString = Math.random().toString(36) | ||
|
||
return ( | ||
<> | ||
<Paper sx={{ p: 4, mb: 2 }}> | ||
<Grid container spacing={3}> | ||
<Grid item sm={4} xs={12}> | ||
<Typography variant="h4" fontWeight={700}> | ||
Recovery email | ||
</Typography> | ||
</Grid> | ||
|
||
<Grid item xs> | ||
<Typography mb={2}> | ||
Receive important notifications about recovery attempts and their status. No spam. We promise!{' '} | ||
{/* TODO: Add link */} | ||
<ExternalLink href="#">Learn more</ExternalLink> | ||
</Typography> | ||
|
||
<div className={css.display}> | ||
<div className={css.email}> | ||
<VisibilityOutlined fontSize="small" /> | ||
<Typography variant="body2" fontWeight={700}> | ||
{randomString + randomString} | ||
</Typography> | ||
<div className={css.blur} /> | ||
</div> | ||
|
||
<div className={css.buttons}> | ||
<Button | ||
onClick={onReveal} | ||
variant="contained" | ||
size="small" | ||
startIcon={<VisibilityOutlined />} | ||
className={css.button} | ||
disableElevation | ||
> | ||
Reveal | ||
</Button> | ||
<Button | ||
onClick={onChange} | ||
variant="contained" | ||
size="small" | ||
startIcon={<SvgIcon component={EditIcon} inheritViewBox />} | ||
className={css.button} | ||
disableElevation | ||
> | ||
Change | ||
</Button> | ||
</div> | ||
</div> | ||
|
||
<Button variant="contained" onClick={onAdd}> | ||
Add email address | ||
</Button> | ||
</Grid> | ||
</Grid> | ||
</Paper> | ||
|
||
<AddEmailDialog open={addEmail} onClose={onClose} /> | ||
</> | ||
) | ||
} |
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,72 @@ | ||
/* Settings */ | ||
|
||
.display { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
background-color: var(--color-background-main); | ||
border: 1px solid var(--color-border-light); | ||
border-radius: 6px; | ||
padding: var(--space-1); | ||
padding-left: var(--space-2); | ||
margin-bottom: var(--space-2); | ||
} | ||
|
||
.email { | ||
display: flex; | ||
align-items: center; | ||
gap: var(--space-1); | ||
position: relative; | ||
} | ||
|
||
.blur { | ||
backdrop-filter: blur(6px); | ||
border-radius: 6px; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
height: calc(100% + var(--space-3)); | ||
width: calc(100% + var(--space-6)); | ||
transform: translate(calc(var(--space-2) * -1), calc(calc(var(--space-1) * 1.5) * -1)); | ||
} | ||
|
||
.buttons { | ||
display: flex; | ||
gap: var(--space-1); | ||
} | ||
|
||
.button { | ||
color: var(--color-text-main); | ||
border: 1px solid var(--color-border-light); | ||
background-color: var(--color-background-paper); | ||
padding-left: var(--space-2); | ||
padding-right: var(--space-2); | ||
} | ||
|
||
/* Dialog */ | ||
|
||
.dialog :global(.MuiDialog-paper) { | ||
max-width: 500px; | ||
} | ||
|
||
.title { | ||
display: flex; | ||
align-items: center; | ||
font-weight: 700; | ||
padding-top: var(--space-3); | ||
} | ||
|
||
.close { | ||
color: var(--color-text-secondary); | ||
margin-left: auto; | ||
} | ||
|
||
.content { | ||
padding: var(--space-2) var(--space-3) var(--space-4); | ||
} | ||
|
||
.actions { | ||
display: flex; | ||
justify-content: space-between; | ||
padding: var(--space-3); | ||
} |
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