mirror of
https://github.com/hexastack/hexabot
synced 2025-05-05 21:34:41 +00:00
fix(frontend): move dialogActions outside the JSX
This commit is contained in:
parent
d3ae363708
commit
14dbe5075a
@ -20,16 +20,18 @@ export const FormDialog = ({
|
|||||||
...rest
|
...rest
|
||||||
}: FormDialogProps) => {
|
}: FormDialogProps) => {
|
||||||
const handleClose = () => rest.onClose?.({}, "backdropClick");
|
const handleClose = () => rest.onClose?.({}, "backdropClick");
|
||||||
|
const dialogActions =
|
||||||
|
rest.hasButtons === false ? null : (
|
||||||
|
<DialogActions style={{ padding: "0.5rem" }}>
|
||||||
|
<DialogFormButtons onCancel={handleClose} onSubmit={onSubmit} />
|
||||||
|
</DialogActions>
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog fullWidth {...rest}>
|
<Dialog fullWidth {...rest}>
|
||||||
<DialogTitle onClose={handleClose}>{title}</DialogTitle>
|
<DialogTitle onClose={handleClose}>{title}</DialogTitle>
|
||||||
<DialogContent>{children}</DialogContent>
|
<DialogContent>{children}</DialogContent>
|
||||||
{rest.hasButtons === false ? null : (
|
{dialogActions}
|
||||||
<DialogActions style={{ padding: "0.5rem" }}>
|
|
||||||
<DialogFormButtons onCancel={handleClose} onSubmit={onSubmit} />
|
|
||||||
</DialogActions>
|
|
||||||
)}
|
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user