fix(striker-ui): expose disableProceed in ConfirmDialog

main
Tsu-ba-me 2 years ago
parent 952d95feac
commit fc016ea719
  1. 10
      striker-ui/components/ConfirmDialog.tsx
  2. 1
      striker-ui/types/ConfirmDialog.d.ts

@ -42,6 +42,7 @@ const ConfirmDialog = forwardRef<
PaperProps: paperProps = {},
...restDialogProps
} = {},
disableProceed: isDisableProceed,
formContent: isFormContent,
loading: isLoading = false,
loadingAction: isLoadingAction = false,
@ -60,8 +61,11 @@ const ConfirmDialog = forwardRef<
ref,
) => {
const { sx: paperSx, ...restPaperProps } = paperProps;
const { sx: proceedButtonSx, ...restProceedButtonProps } =
proceedButtonProps;
const {
disabled: proceedButtonDisabled = isDisableProceed,
sx: proceedButtonSx,
...restProceedButtonProps
} = proceedButtonProps;
const [isOpen, setIsOpen] = useState<boolean>(openInitially);
@ -142,6 +146,7 @@ const ConfirmDialog = forwardRef<
const proceedButtonElement = useMemo(
() => (
<ContainedButton
disabled={proceedButtonDisabled}
onClick={proceedButtonClickEventHandler}
type={proceedButtonType}
{...restProceedButtonProps}
@ -160,6 +165,7 @@ const ConfirmDialog = forwardRef<
[
actionProceedText,
proceedButtonClickEventHandler,
proceedButtonDisabled,
proceedButtonSx,
proceedButtonType,
proceedColour,

@ -3,6 +3,7 @@ type ConfirmDialogOptionalProps = {
closeOnProceed?: boolean;
contentContainerProps?: import('../components/FlexBox').FlexBoxProps;
dialogProps?: Partial<import('@mui/material').DialogProps>;
disableProceed?: boolean;
formContent?: boolean;
loading?: boolean;
loadingAction?: boolean;

Loading…
Cancel
Save