|
1 |
| -importDialogActionsfrom"@material-ui/core/DialogActions" |
2 |
| -importDialogContentfrom"@material-ui/core/DialogContent" |
3 | 1 | importDialogContentTextfrom"@material-ui/core/DialogContentText"
|
4 | 2 | import{makeStyles}from"@material-ui/core/styles"
|
5 | 3 | import{FC}from"react"
|
6 | 4 | import*asTypesGenfrom"../../api/typesGenerated"
|
7 |
| -import{CodeBlock}from"../CodeBlock/CodeBlock" |
8 |
| -import{Dialog,DialogActionButtons,DialogTitle}from"../Dialog/Dialog" |
| 5 | +import{CodeExample}from"../CodeExample/CodeExample" |
| 6 | +import{ConfirmDialog}from"../ConfirmDialog/ConfirmDialog" |
9 | 7 |
|
10 | 8 | exportinterfaceResetPasswordDialogProps{
|
11 | 9 | open:boolean
|
@@ -36,32 +34,35 @@ export const ResetPasswordDialog: FC<ResetPasswordDialogProps> = ({
|
36 | 34 | })=>{
|
37 | 35 | conststyles=useStyles()
|
38 | 36 |
|
39 |
| -return( |
40 |
| -<Dialogopen={open}onClose={onClose}> |
41 |
| -<DialogTitletitle={Language.title}/> |
42 |
| - |
43 |
| -<DialogContent> |
44 |
| -<DialogContentTextvariant="subtitle2">{Language.message(user?.username)}</DialogContentText> |
45 |
| - |
46 |
| -<DialogContentTextcomponent="div"> |
47 |
| -<CodeBlocklines={[newPassword??""]}className={styles.codeBlock}/> |
48 |
| -</DialogContentText> |
49 |
| -</DialogContent> |
| 37 | +constdescription=( |
| 38 | +<> |
| 39 | +<DialogContentTextvariant="subtitle2">{Language.message(user?.username)}</DialogContentText> |
| 40 | +<DialogContentTextcomponent="div"className={styles.codeBlock}> |
| 41 | +<CodeExamplecode={newPassword??""}className={styles.codeExample}/> |
| 42 | +</DialogContentText> |
| 43 | +</> |
| 44 | +) |
50 | 45 |
|
51 |
| -<DialogActions> |
52 |
| -<DialogActionButtons |
53 |
| -onCancel={onClose} |
54 |
| -confirmText={Language.confirmText} |
55 |
| -onConfirm={onConfirm} |
56 |
| -confirmLoading={loading} |
57 |
| -/> |
58 |
| -</DialogActions> |
59 |
| -</Dialog> |
| 46 | +return( |
| 47 | +<ConfirmDialog |
| 48 | +type="info" |
| 49 | +hideCancel={false} |
| 50 | +open={open} |
| 51 | +onConfirm={onConfirm} |
| 52 | +onClose={onClose} |
| 53 | +title={Language.title} |
| 54 | +confirmLoading={loading} |
| 55 | +confirmText={Language.confirmText} |
| 56 | +description={description} |
| 57 | +/> |
60 | 58 | )
|
61 | 59 | }
|
62 | 60 |
|
63 | 61 | constuseStyles=makeStyles(()=>({
|
64 | 62 | codeBlock:{
|
| 63 | +marginBottom:0, |
| 64 | +}, |
| 65 | +codeExample:{ |
65 | 66 | minHeight:"auto",
|
66 | 67 | userSelect:"all",
|
67 | 68 | width:"100%",
|
|