File tree Expand file tree Collapse file tree 1 file changed +27
-5
lines changed
Expand file tree Collapse file tree 1 file changed +27
-5
lines changed Original file line number Diff line number Diff line change 1+ import { useEffect } from "react" ;
2+ import { useRouter } from "next/router" ;
3+
14export default function Custom404 ( ) {
5+ const router = useRouter ( ) ;
6+
7+ const goToMain = ( ) => {
8+ router . push ( "/" ) ;
9+ } ;
10+
11+ useEffect ( ( ) => {
12+ const timer = setTimeout ( ( ) => {
13+ router . push ( "/" ) ;
14+ } , 5000 ) ;
15+
16+ return ( ) => clearTimeout ( timer ) ;
17+ } , [ router ] ) ;
18+
219 return (
3- < div className = "flex flex-col items-center justify-center h-screen text-center" >
4- < h1 className = "text-4xl font-bold text-[var(--primary)]" >
5- 404 Not Found
6- </ h1 >
7- < p className = "mt-2 text-lg text-black3" > 페이지를 찾을 수 없습니다.</ p >
20+ < div className = "flex flex-col items-center justify-center text-center h-screen bg-[var(--color-gray5)] gap-2" >
21+ < h1 className = "font-24b text-[var(--primary)]" > 404 Not Found</ h1 >
22+ < p className = "font-16r text-black3" > 페이지를 찾을 수 없습니다.</ p >
23+ < p className = "font-16r text-black3" > 5초 후 홈페이지로 이동합니다.</ p >
24+ < button
25+ onClick = { goToMain }
26+ className = "w-[200px] h-[50px] bg-[var(--primary)] font-16m text-white rounded-lg cursor-pointer"
27+ >
28+ 홈페이지 이동하기
29+ </ button >
830 </ div >
931 ) ;
1032}
You can’t perform that action at this time.
0 commit comments