11import { useEffect } from "react" ;
22
33import confetti from "canvas-confetti" ;
4+ import type { Options as ConfettiOptions } from "canvas-confetti" ;
5+
6+ import Toast from "../ui/Toast/Toast" ;
47
58import HomeNavigateConfirmModal from "@/components/HomeNavigateConfirmModal/HomeNavigateConfirmModal" ;
69import styles from "@/components/ReviewResult/ReviewResult.module.scss" ;
@@ -9,11 +12,15 @@ import IconButton from "@/components/ui/IconButton/IconButton";
912import Text from "@/components/ui/Text/Text" ;
1013
1114import { useOverlay } from "@/hooks/common/useOverlay" ;
12-
13- import type { Options as ConfettiOptions } from "canvas-confetti" ;
15+ import useToast from "@/hooks/common/useToast" ;
1416
1517const ReviewResult = ( ) => {
1618 const { isOpen, handleClose, handleOpen } = useOverlay ( ) ;
19+ const { isToast, showToast } = useToast ( 1000 ) ; // 1초 후 사라짐
20+
21+ const handleCopy = ( ) => {
22+ showToast ( ) ;
23+ } ;
1724
1825 const handleConfetti = ( ) => {
1926 const setting : ConfettiOptions = {
@@ -51,12 +58,16 @@ const ReviewResult = () => {
5158 거예요.
5259 </ Text >
5360 < div className = { styles . IconBtn } >
54- < IconButton text = "복사하기" iconName = "paste" size = "sm" />
61+ < IconButton text = "복사하기" iconName = "paste" size = "sm" onClick = { handleCopy } />
5562 </ div >
5663 </ div >
64+
5765 < div className = { styles . Bottom } >
58- < Button text = "다시생성" variant = "secondary" />
59- < Button text = "홈으로 가기" onClick = { handleOpen } />
66+ { isToast && < Toast text = "링크가 복사되었어요." /> }
67+ < div className = { styles . ButtonBox } >
68+ < Button text = "다시생성" variant = "secondary" />
69+ < Button text = "홈으로 가기" onClick = { handleOpen } />
70+ </ div >
6071 </ div >
6172
6273 < HomeNavigateConfirmModal isOpen = { isOpen } handleClose = { handleClose } />
0 commit comments