Skip to content

Commit

Permalink
fix: type 옵셔널로 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
hamo-o committed Sep 3, 2024
1 parent 950d05a commit c7f43aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 0 additions & 3 deletions packages/wow-ui/src/components/Toast/Toast.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export const Default: Story = {
args: {
text: "Text",
subText: "subtext",
type: "default",
},
};

Expand All @@ -74,7 +73,6 @@ export const Icon: Story = {
args: {
text: "Text",
subText: "subtext",
type: "default",
icon: <Warn />,
},
};
Expand All @@ -91,6 +89,5 @@ export const IconArrow: Story = {
export const TwoLines: Story = {
args: {
text: "TextTextTextTextTextTextTextTextTextTextTextTextTextTextTextText",
type: "default",
},
};
6 changes: 3 additions & 3 deletions packages/wow-ui/src/components/Toast/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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] - 토스트 컴포넌트의 보조 텍스트.
Expand All @@ -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;
Expand All @@ -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 <Close stroke="outline" width={14} />;
else if (type === "arrow") return <RightArrow stroke="outline" />;
Expand Down

0 comments on commit c7f43aa

Please sign in to comment.