File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ import { useNavigate } from "react-router-dom" ;
2+ import Button from "./components/button" ;
3+ import styled from "styled-components" ;
4+
5+ export const NotFound = ( ) => {
6+ const router = useNavigate ( ) ;
7+ return (
8+ < Container >
9+ < h1 > 404 Not Found</ h1 >
10+ < Button width = "100" onClick = { ( ) => router ( '/main' ) } > 메인으로 가기</ Button >
11+ </ Container >
12+ ) ;
13+ }
14+
15+ const Container = styled . div `
16+ display: flex;
17+ flex-direction: column;
18+ align-items: center;
19+ justify-content: center;
20+ height: 100vh;
21+ gap: 16px;
22+ `
Original file line number Diff line number Diff line change 1+ import { NotFound } from "@/404" ;
12import Attendance from "@/pages/attendance" ;
23import Bug from "@/pages/bug" ;
34import Login from "@/pages/login" ;
@@ -21,6 +22,10 @@ export const Router = createBrowserRouter([
2122 path : "" ,
2223 element : < Login /> ,
2324 } ,
25+ {
26+ path : '*' ,
27+ element : < NotFound />
28+ } ,
2429 {
2530 path : "main" ,
2631 element : < Main /> ,
You can’t perform that action at this time.
0 commit comments