Skip to content

Commit

Permalink
chore: add props to dialog buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
k0stik committed Oct 19, 2023
1 parent b1be4d0 commit 5f214fa
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/mui/components/dialog/Dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable react/jsx-props-no-spreading */
import LoadingButton from "@mui/lab/LoadingButton";
import Button from "@mui/material/Button";
import Button, { ButtonProps } from "@mui/material/Button";
import Dialog, { DialogProps } from "@mui/material/Dialog";
import DialogActions from "@mui/material/DialogActions";
import DialogContent from "@mui/material/DialogContent";
Expand Down Expand Up @@ -30,6 +31,8 @@ export interface DialogModalProps extends DialogProps {
renderFooterCustom?: () => React.ReactNode;
submitButtonText?: string;
cancelButtonText?: string;
submitButtonProps?: ButtonProps;
cancelButtonProps?: ButtonProps;
draggableId?: string;
}

Expand All @@ -54,6 +57,8 @@ function DialogModal({
renderFooterCustom,
submitButtonText = "Submit",
cancelButtonText = "Cancel",
submitButtonProps,
cancelButtonProps,
PaperComponent,
draggableId,
}: DialogModalProps) {
Expand Down Expand Up @@ -107,7 +112,8 @@ function DialogModal({
color="neutral"
data-dismiss="modal"
aria-label={cancelButtonText}
onClick={handleCancel}>
onClick={handleCancel}
{...cancelButtonProps}>
{cancelButtonText}
</Button>
<LoadingButton
Expand All @@ -116,7 +122,8 @@ function DialogModal({
variant="text"
aria-label={submitButtonText}
disabled={isSubmitButtonDisabled || isSubmitButtonProcessing}
onClick={handleSubmit}>
onClick={handleSubmit}
{...submitButtonProps}>
{submitButtonText}
</LoadingButton>
</DialogActions>
Expand Down

0 comments on commit 5f214fa

Please sign in to comment.