|
1 |
| -import DialogActions from "@material-ui/core/DialogActions" |
2 |
| -import DialogContent from "@material-ui/core/DialogContent" |
3 | 1 | import DialogContentText from "@material-ui/core/DialogContentText"
|
4 | 2 | import { makeStyles } from "@material-ui/core/styles"
|
5 | 3 | import { FC } from "react"
|
6 | 4 | import * as TypesGen from "../../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 | export interface ResetPasswordDialogProps {
|
11 | 9 | open: boolean
|
@@ -36,32 +34,35 @@ export const ResetPasswordDialog: FC<ResetPasswordDialogProps> = ({
|
36 | 34 | }) => {
|
37 | 35 | const styles = useStyles()
|
38 | 36 |
|
39 |
| - return ( |
40 |
| - <Dialog open={open} onClose={onClose}> |
41 |
| - <DialogTitle title={Language.title} /> |
42 |
| - |
43 |
| - <DialogContent> |
44 |
| - <DialogContentText variant="subtitle2">{Language.message(user?.username)}</DialogContentText> |
45 |
| - |
46 |
| - <DialogContentText component="div"> |
47 |
| - <CodeBlock lines={[newPassword ?? ""]} className={styles.codeBlock} /> |
48 |
| - </DialogContentText> |
49 |
| - </DialogContent> |
| 37 | + const description = ( |
| 38 | + <> |
| 39 | + <DialogContentText variant="subtitle2">{Language.message(user?.username)}</DialogContentText> |
| 40 | + <DialogContentText component="div" className={styles.codeBlock}> |
| 41 | + <CodeExample code={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 | const useStyles = makeStyles(() => ({
|
64 | 62 | codeBlock: {
|
| 63 | + marginBottom: 0, |
| 64 | + }, |
| 65 | + codeExample: { |
65 | 66 | minHeight: "auto",
|
66 | 67 | userSelect: "all",
|
67 | 68 | width: "100%",
|
|
0 commit comments