-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 사용자 지정 스타일 받기 * feat: Toast 스토리북 Docs 업데이트 * feat: 스토리북 공통 파라미터 분리 * feat: 토스트 함수 중복 호출 방지 * feat: Toast close 함수 추가 --------- Co-authored-by: solar3070 <>
- Loading branch information
Showing
11 changed files
with
140 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
import React, { forwardRef } from "react"; | ||
import * as Toast from "./parts"; | ||
import { ToastOptionType } from "./types"; | ||
|
||
function ToastComponent({ icon, content, action }: ToastOptionType) { | ||
function ToastComponent(props: ToastOptionType, ref: React.Ref<HTMLDivElement>) { | ||
const { icon = "success", content, action, style } = props; | ||
|
||
return ( | ||
<Toast.Root icon={icon}> | ||
<Toast.Content content={content} /> | ||
{action && <Toast.Action {...action} />} | ||
<Toast.Root ref={ref} style={style?.root} icon={icon}> | ||
<Toast.Content style={style?.content} content={content} /> | ||
{action && <Toast.Action style={style?.action} {...action} />} | ||
</Toast.Root> | ||
); | ||
} | ||
|
||
export default ToastComponent; | ||
export default forwardRef(ToastComponent); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters