-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat: 가입 완료 시 성공 문구 출력하는 공용 Modal 작성 #5
- Loading branch information
1 parent
6365e75
commit 088f613
Showing
3 changed files
with
76 additions
and
20 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import CheckIconLarge from '@/assets/icons/checkIconLarge.svg?react'; | ||
import { useEffect } from 'react'; | ||
|
||
type CompleteModalProps = { | ||
title: string; | ||
content: string; | ||
onNext: () => void; | ||
}; | ||
|
||
const CompleteModal = ({ title, content, onNext }: CompleteModalProps) => { | ||
// 2초 뒤에 페이지 이동 | ||
useEffect(() => { | ||
const timer = setTimeout(() => { | ||
onNext(); | ||
}, 2000); | ||
|
||
return () => clearTimeout(timer); | ||
}, [onNext]); | ||
return ( | ||
<div className="w-screen h-screen px-14 flex flex-col gap-4 items-center justify-center text-center"> | ||
<CheckIconLarge /> | ||
<div className="title-2">{title}</div> | ||
<div className="body-2">{content}</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default CompleteModal; |
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