mirror of
https://github.com/hexastack/hexabot
synced 2025-02-23 04:48:51 +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
|
||||
}: FormDialogProps) => {
|
||||
const handleClose = () => rest.onClose?.({}, "backdropClick");
|
||||
const dialogActions =
|
||||
rest.hasButtons === false ? null : (
|
||||
<DialogActions style={{ padding: "0.5rem" }}>
|
||||
<DialogFormButtons onCancel={handleClose} onSubmit={onSubmit} />
|
||||
</DialogActions>
|
||||
);
|
||||
|
||||
return (
|
||||
<Dialog fullWidth {...rest}>
|
||||
<DialogTitle onClose={handleClose}>{title}</DialogTitle>
|
||||
<DialogContent>{children}</DialogContent>
|
||||
{rest.hasButtons === false ? null : (
|
||||
<DialogActions style={{ padding: "0.5rem" }}>
|
||||
<DialogFormButtons onCancel={handleClose} onSubmit={onSubmit} />
|
||||
</DialogActions>
|
||||
)}
|
||||
{dialogActions}
|
||||
</Dialog>
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user