From c7f43aaafe23f3d15f86aca7ca513004176f540b Mon Sep 17 00:00:00 2001 From: hamo-o Date: Tue, 3 Sep 2024 18:25:59 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20type=20=EC=98=B5=EC=85=94=EB=84=90?= =?UTF-8?q?=EB=A1=9C=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/wow-ui/src/components/Toast/Toast.stories.tsx | 3 --- packages/wow-ui/src/components/Toast/index.tsx | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/wow-ui/src/components/Toast/Toast.stories.tsx b/packages/wow-ui/src/components/Toast/Toast.stories.tsx index 6d588ab7..fc726c55 100644 --- a/packages/wow-ui/src/components/Toast/Toast.stories.tsx +++ b/packages/wow-ui/src/components/Toast/Toast.stories.tsx @@ -50,7 +50,6 @@ export const Default: Story = { args: { text: "Text", subText: "subtext", - type: "default", }, }; @@ -74,7 +73,6 @@ export const Icon: Story = { args: { text: "Text", subText: "subtext", - type: "default", icon: , }, }; @@ -91,6 +89,5 @@ export const IconArrow: Story = { export const TwoLines: Story = { args: { text: "TextTextTextTextTextTextTextTextTextTextTextTextTextTextTextText", - type: "default", }, }; diff --git a/packages/wow-ui/src/components/Toast/index.tsx b/packages/wow-ui/src/components/Toast/index.tsx index 90f4652e..fd54e56e 100644 --- a/packages/wow-ui/src/components/Toast/index.tsx +++ b/packages/wow-ui/src/components/Toast/index.tsx @@ -11,7 +11,7 @@ import { Close, RightArrow } from "wowds-icons"; * @description 토스트 컴포넌트입니다. * * @param {string} id - 토스트 컴포넌트의 id. - * @param {"default"|"close"|"arrow"} type - 토스트 컴포넌트의 타입. + * @param {"default"|"close"|"arrow"} [type] - 토스트 컴포넌트의 타입. * @param {string} text - 토스트 컴포넌트의 메인 텍스트. * @param {ReactNode} icon - 토스트 컴포넌트의 좌측에 들어갈 아이콘. * @param {string} [subText] - 토스트 컴포넌트의 보조 텍스트. @@ -21,7 +21,7 @@ import { Close, RightArrow } from "wowds-icons"; export interface ToastProps extends FlexProps { id: string; - type: "default" | "close" | "arrow"; + type?: "default" | "close" | "arrow"; text: string; icon?: ReactNode; subText?: string; @@ -30,7 +30,7 @@ export interface ToastProps extends FlexProps { } const Toast = forwardRef( - ({ text, subText, type, icon, ...rest }: ToastProps) => { + ({ text, subText, type = "default", icon, ...rest }: ToastProps) => { const TypeIconComponent = () => { if (type === "close") return ; else if (type === "arrow") return ;