Added "info" variant for Action Dialog
Info messages should not require any kind of confirmation, so I added option to disable ConfirmButton by providing "info" as a variant
This commit is contained in:
parent
1480a4478c
commit
d0422323ba
1 changed files with 17 additions and 15 deletions
|
@ -33,7 +33,7 @@ interface ActionDialogProps extends DialogProps {
|
||||||
confirmButtonState: ConfirmButtonTransitionState;
|
confirmButtonState: ConfirmButtonTransitionState;
|
||||||
maxWidth?: "xs" | "sm" | "md" | "lg" | "xl" | false;
|
maxWidth?: "xs" | "sm" | "md" | "lg" | "xl" | false;
|
||||||
title: string;
|
title: string;
|
||||||
variant?: "default" | "delete";
|
variant?: "default" | "delete" | "info";
|
||||||
onConfirm();
|
onConfirm();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,6 +61,7 @@ const ActionDialog: React.FC<ActionDialogProps> = props => {
|
||||||
<Button onClick={onClose}>
|
<Button onClick={onClose}>
|
||||||
<FormattedMessage {...buttonMessages.back} />
|
<FormattedMessage {...buttonMessages.back} />
|
||||||
</Button>
|
</Button>
|
||||||
|
{variant !== "info" && (
|
||||||
<ConfirmButton
|
<ConfirmButton
|
||||||
transitionState={confirmButtonState}
|
transitionState={confirmButtonState}
|
||||||
color="primary"
|
color="primary"
|
||||||
|
@ -75,6 +76,7 @@ const ActionDialog: React.FC<ActionDialogProps> = props => {
|
||||||
? intl.formatMessage(buttonMessages.delete)
|
? intl.formatMessage(buttonMessages.delete)
|
||||||
: intl.formatMessage(buttonMessages.confirm))}
|
: intl.formatMessage(buttonMessages.confirm))}
|
||||||
</ConfirmButton>
|
</ConfirmButton>
|
||||||
|
)}
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue