-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
23f7682
commit 9ab6b92
Showing
2 changed files
with
32 additions
and
34 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 |
---|---|---|
|
@@ -25,12 +25,13 @@ const useStyles = makeStyles((theme) => ({ | |
})); | ||
|
||
const AccountProfile: React.FC<{ | ||
data?: any; | ||
handleRemove: any; | ||
isLoading: boolean; | ||
errors: string[]; | ||
setShowProfile: any; | ||
setShowPassword: any; | ||
}> = ({ handleRemove, isLoading, errors, setShowProfile, setShowPassword }) => { | ||
}> = ({ data, handleRemove, isLoading, errors, setShowProfile, setShowPassword }) => { | ||
const classes = useStyles(); | ||
|
||
const [open, setOpen] = React.useState(false); | ||
|
@@ -43,26 +44,22 @@ const AccountProfile: React.FC<{ | |
setOpen(false); | ||
}; | ||
|
||
const user = { | ||
avatar: '/avatar_11.png', | ||
}; | ||
|
||
return ( | ||
<Card> | ||
<CardContent> | ||
<div className={classes.details}> | ||
<div> | ||
<Typography gutterBottom variant="h2"> | ||
John Doe | ||
{data?.firstName} {data?.lastName} | ||
</Typography> | ||
<Typography color="textSecondary" variant="body1"> | ||
[email protected] | ||
{data?.email} | ||
</Typography> | ||
<Typography color="textSecondary" variant="body1"> | ||
Account created on 11/22/2019 | ||
Account created on {data?.createdAt} | ||
</Typography> | ||
</div> | ||
<Avatar className={classes.avatar} src={user.avatar} /> | ||
<Avatar className={classes.avatar} src={data?.gravatar} title={`Gravatar for ${data?.email}`} /> | ||
</div> | ||
<br /> | ||
<Button variant="text" className={classes.uploadButton} onClick={setShowProfile}> | ||
|
@@ -82,31 +79,31 @@ const AccountProfile: React.FC<{ | |
</CardActions> | ||
{open && ( | ||
<Modal title="Delete Account" open={open} handleClose={handleClose}> | ||
<> | ||
<ErrorList errors={errors} /> | ||
<p> | ||
If you delete your account, all data related to your account will be <strong>permanently deleted</strong>. | ||
Are you sure you want to proceed? | ||
</p> | ||
<Button | ||
disabled={isLoading} | ||
className={classes.modalButton} | ||
onClick={handleRemove} | ||
color="primary" | ||
variant="contained" | ||
> | ||
Confirm | ||
</Button> | ||
<Button | ||
disabled={isLoading} | ||
className={classes.modalButton} | ||
onClick={handleClose} | ||
color="primary" | ||
variant="text" | ||
> | ||
Cancel | ||
</Button> | ||
</> | ||
<> | ||
<ErrorList errors={errors} /> | ||
<p> | ||
If you delete your account, all data related to your account will be <strong>permanently deleted</strong>. | ||
Are you sure you want to proceed? | ||
</p> | ||
<Button | ||
disabled={isLoading} | ||
className={classes.modalButton} | ||
onClick={handleRemove} | ||
color="primary" | ||
variant="contained" | ||
> | ||
Confirm | ||
</Button> | ||
<Button | ||
disabled={isLoading} | ||
className={classes.modalButton} | ||
onClick={handleClose} | ||
color="primary" | ||
variant="text" | ||
> | ||
Cancel | ||
</Button> | ||
</> | ||
</Modal> | ||
)} | ||
</Card> | ||
|
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