Skip to content

Commit

Permalink
fix: className prop 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
yougyung committed Mar 2, 2024
1 parent 9eaad12 commit 75a4c49
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
1 change: 0 additions & 1 deletion app/ui/view/molecule/modal/modal.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export default meta;
interface ModalProps extends React.PropsWithChildren {
open: boolean;
onOpenChange: () => void;
className?: string;
}

export const Default: StoryObj<typeof meta> = {
Expand Down
4 changes: 1 addition & 3 deletions app/ui/view/molecule/modal/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ import { cn } from '../../../../utils/shadcn/utils';
interface ModalProps extends React.PropsWithChildren {
open: boolean;
onOpenChange: () => void;
className?: string;
}

const fadeAnimation =
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0';
const noneSlideAnimation =
'data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]';

const Modal = ({ className, children, open, onOpenChange }: ModalProps) => (
const Modal = ({ children, open, onOpenChange }: ModalProps) => (
<Root open={open} onOpenChange={onOpenChange}>
<Portal>
<Overlay className={cn('fixed inset-0 zIndex-3 bg-black/50', fadeAnimation)} />
Expand All @@ -24,7 +23,6 @@ const Modal = ({ className, children, open, onOpenChange }: ModalProps) => (
'outline-none fixed left-[50%] top-[50%] zIndex-3 max-w-[90%] min-w-[30%] overflow-y-auto translate-x-[-50%] translate-y-[-50%] bg-white p-6 shadow-lg duration-200 rounded-lg max-h-[70vh] lg:max-h-[90vh]',
noneSlideAnimation,
fadeAnimation,
className,
)}
>
{children}
Expand Down

0 comments on commit 75a4c49

Please sign in to comment.