mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
fix(frontend): add dialog hasButtons option
This commit is contained in:
parent
9b1d6c5381
commit
584eb83d68
@ -22,16 +22,20 @@ export const FormDialog = ({
|
||||
...rest
|
||||
}: FormDialogProps) => {
|
||||
const onCancel = () => rest.onClose?.({}, "backdropClick");
|
||||
|
||||
return (
|
||||
<Dialog fullWidth {...rest}>
|
||||
<DialogTitle onClose={onCancel}>{title}</DialogTitle>
|
||||
<DialogContent>{children}</DialogContent>
|
||||
const dialogActions =
|
||||
rest.hasButtons === false ? null : (
|
||||
<DialogActions style={{ padding: "0.5rem" }}>
|
||||
<DialogFormButtons
|
||||
{...{ onSubmit, onCancel, confirmButtonProps, cancelButtonProps }}
|
||||
/>
|
||||
</DialogActions>
|
||||
);
|
||||
|
||||
return (
|
||||
<Dialog fullWidth {...rest}>
|
||||
<DialogTitle onClose={onCancel}>{title}</DialogTitle>
|
||||
<DialogContent>{children}</DialogContent>
|
||||
{dialogActions}
|
||||
</Dialog>
|
||||
);
|
||||
};
|
||||
|
@ -150,7 +150,8 @@ export interface DialogProviderProps {
|
||||
// form dialog
|
||||
export interface FormDialogProps
|
||||
extends FormButtonsProps,
|
||||
Omit<MuiDialogProps, "onSubmit"> {
|
||||
Omit<MuiDialogProps, "onSubmit">,
|
||||
DialogExtraOptions {
|
||||
title?: string;
|
||||
children?: React.ReactNode;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user