File tree Expand file tree Collapse file tree 4 files changed +52
-3
lines changed Expand file tree Collapse file tree 4 files changed +52
-3
lines changed Original file line number Diff line number Diff line change @@ -11,3 +11,4 @@ export const RegisterDogPage = lazy(() => import('~pages/RegisterPage/Dog'))
11
11
export const WalkCompletePage = lazy ( ( ) => import ( '~pages/WalkCompletePage' ) )
12
12
export const ProfilePage = lazy ( ( ) => import ( '~pages/ProfilePage' ) )
13
13
export const FamilyDDangPage = lazy ( ( ) => import ( '~pages/FamilyDDangPage' ) )
14
+ export const NotFoundPage = lazy ( ( ) => import ( '~pages/NotFoundPage' ) )
Original file line number Diff line number Diff line change
1
+ import DogFood from '~assets/dog_food.svg?react'
2
+ import { ActionButton } from '~components/Button/ActionButton'
3
+ import { Typo24 } from '~components/Typo'
4
+ import * as S from './styles'
5
+ import { useNavigate } from 'react-router-dom'
6
+
7
+ export default function NotFoundPage ( ) {
8
+ const navigate = useNavigate ( )
9
+ return (
10
+ < S . NotFoundPage >
11
+ < S . ErrorMessage > 404!</ S . ErrorMessage >
12
+ < Typo24 $textAlign = 'center' $weight = '800' style = { { marginBottom : 24 } } >
13
+ 요청하신 페이지를 찾을 수 없어요
14
+ </ Typo24 >
15
+ < ActionButton $type = 'roundedRect' onClick = { ( ) => navigate ( - 1 ) } >
16
+ 되돌아가기
17
+ </ ActionButton >
18
+ < S . Wrapper >
19
+ < DogFood />
20
+ </ S . Wrapper >
21
+ </ S . NotFoundPage >
22
+ )
23
+ }
Original file line number Diff line number Diff line change
1
+ import { styled } from 'styled-components'
2
+
3
+ export const NotFoundPage = styled . div `
4
+ height: 100%;
5
+ display: flex;
6
+ align-items: center;
7
+ justify-content: center;
8
+ flex-direction: column;
9
+ padding: 0 20px 30%;
10
+ `
11
+
12
+ export const ErrorMessage = styled . p `
13
+ font-size: 64px;
14
+ text-align: center;
15
+ font-weight: 800;
16
+ color: ${ ( { theme } ) => theme . colors . brand . default } ;
17
+ `
18
+ export const Wrapper = styled . div `
19
+ position: absolute;
20
+ bottom: 12%;
21
+ `
Original file line number Diff line number Diff line change 1
- import Footer from '~components/Footer'
2
1
import { createBrowserRouter , Outlet } from 'react-router-dom'
3
- import * as Pages from './components/LazyComponents'
4
- import ModalContainer from '~modals/ModalContainer'
5
2
import { WebSocketProvider } from '~/WebSocketContext'
3
+ import Footer from '~components/Footer'
4
+ import ModalContainer from '~modals/ModalContainer'
5
+ import * as Pages from './components/LazyComponents'
6
6
7
7
export const router = createBrowserRouter ( [
8
8
{
@@ -47,6 +47,10 @@ export const router = createBrowserRouter([
47
47
path : '/profile/:id' ,
48
48
element : < Pages . ProfilePage /> ,
49
49
} ,
50
+ {
51
+ path : '*' ,
52
+ element : < Pages . NotFoundPage /> ,
53
+ } ,
50
54
] ,
51
55
} ,
52
56
{
You can’t perform that action at this time.
0 commit comments