File tree Expand file tree Collapse file tree 5 files changed +76
-1
lines changed
Expand file tree Collapse file tree 5 files changed +76
-1
lines changed Original file line number Diff line number Diff line change @@ -5,3 +5,4 @@ export { default as History } from './history/History';
55export { default as SignUp } from './signup/SignUp' ;
66export { default as Edit } from './edit/Edit' ;
77export { default as GoogleCallback } from './callback/GoogleCallback' ;
8+ export { default as NotFound } from './notFound/NotFound' ;
Original file line number Diff line number Diff line change 1+ import { style } from '@vanilla-extract/css' ;
2+
3+ import { colors , fonts , layout } from '@/style/token' ;
4+
5+ export const container = style ( [
6+ layout . columnCenter ,
7+ {
8+ gap : '4rem' ,
9+ height : 'calc(100vh - 15rem - 8rem)' ,
10+ backgroundColor : colors . grey1 ,
11+ textAlign : 'center' ,
12+ } ,
13+ ] ) ;
14+
15+ export const title = style ( [
16+ fonts . display03 ,
17+ {
18+ color : colors . grey11 ,
19+ } ,
20+ ] ) ;
21+
22+ export const button = style ( [
23+ fonts . subtitle05 ,
24+ {
25+ width : '19.6rem' ,
26+ height : '5.4rem' ,
27+ padding : '1.4rem 2rem' ,
28+ backgroundColor : colors . blue06 ,
29+ borderRadius : '8px' ,
30+ color : colors . grey11 ,
31+ textAlign : 'center' ,
32+ } ,
33+ ] ) ;
Original file line number Diff line number Diff line change 1+ import { useNavigate } from 'react-router-dom' ;
2+
3+ import * as styles from './NotFound.css' ;
4+
5+ import { PATH } from '@/route' ;
6+
7+ const TEXT = {
8+ title : [ '찾으시는 페이지가 없어요' , '홈으로 돌아가 볼까요?' ] ,
9+ button : '홈으로 가기' ,
10+ } as const ;
11+
12+ const NotFound = ( ) => {
13+ const navigate = useNavigate ( ) ;
14+
15+ const handleGoHome = ( ) => {
16+ navigate ( PATH . ROOT ) ;
17+ } ;
18+
19+ return (
20+ < main className = { styles . container } >
21+ < h1 className = { styles . title } >
22+ { TEXT . title . map ( ( line , index ) => (
23+ < span key = { `${ line } -${ index } ` } >
24+ { line }
25+ { index !== TEXT . title . length - 1 && < br /> }
26+ </ span >
27+ ) ) }
28+ </ h1 >
29+ < button type = "button" className = { styles . button } onClick = { handleGoHome } >
30+ { TEXT . button }
31+ </ button >
32+ </ main >
33+ ) ;
34+ } ;
35+
36+ export default NotFound ;
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ import type { RouteObject } from 'react-router-dom';
22
33import { PATH } from './path' ;
44
5+ import { Home , NotFound } from '@/page' ;
56import { Layout } from '@/shared/component/Layout' ;
6- import Home from '@/page/home/Home' ;
77import Intro from '@/page/intro/Intro' ;
88
99export const mainRoutes : RouteObject [ ] = [
@@ -81,6 +81,10 @@ export const mainRoutes: RouteObject[] = [
8181 return { Component : SignUp } ;
8282 } ,
8383 } ,
84+ {
85+ path : PATH . NOT_FOUND ,
86+ element : < NotFound /> ,
87+ } ,
8488 ] ,
8589 } ,
8690] ;
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export const PATH = {
1212 PRIVACY : '/privacy' ,
1313 SIGNUP : '/signup' ,
1414 REDIRECT : '/auth/google/callback' ,
15+ NOT_FOUND : '*' ,
1516} as const ;
1617
1718export type PathType = ( typeof PATH ) [ keyof typeof PATH ] ;
You can’t perform that action at this time.
0 commit comments