Skip to content

Commit

Permalink
feat: change NonModal type as nonModal instead of undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
HyejinYang committed Apr 15, 2024
1 parent 6eadc6d commit 09d3dea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/design-system/src/components/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type { SxProps } from "@mui/material/styles";
export interface DialogPropsBase {
isOpen: boolean;
isSmall?: boolean;
modalType?: "passive" | "action";
modalType: "passive" | "action" | "nonModal";
onClose(): void;
children: React.ReactNode;
sx?: SxProps;
Expand All @@ -31,7 +31,7 @@ export interface ActionModalProps extends DialogPropsBase {
export type ModalProps = PassiveModalProps | ActionModalProps;

export interface NonModalProps extends DialogPropsBase {
modalType?: undefined;
modalType: "nonModal";
actions: React.ReactNode;
}

Expand All @@ -40,7 +40,7 @@ export type DialogProps = ModalProps | NonModalProps;
function Dialog(props: DialogProps) {
const { isOpen, modalType, onClose } = props;

const nonModal = !modalType;
const nonModal = modalType === "nonModal";
const isActionModal = modalType === "action";
const isPassiveModal = modalType === "passive";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export const NonModal: Story = {

<Dialog
className={classNameFromGlobal}
modalType="nonModal"
isOpen={isOpen}
isSmall
onClose={close}
Expand Down

0 comments on commit 09d3dea

Please sign in to comment.