Skip to content

Commit c523c2c

Browse files
committed
adding 404 page (NotFound) and style root to
1 parent 32c3657 commit c523c2c

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

src/App.jsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
import { ThemeProvider } from "@/components/theme-provider"
22
import { Route, Routes } from "react-router-dom"
3-
import Home from "@/pages/Home"
3+
// Layouts
44
import Header from "@/layouts/header"
5+
// Pages
6+
import Home from "@/pages/Home"
7+
import NotFound from '@/pages/404'
58

69
function App() {
710

811
return(
912
<ThemeProvider defaultTheme="system" storageKey="ui-theme">
1013
<Header />
1114
<Routes>
12-
<Route path="React-Project/" element={<Home />} />
15+
<Route path='React-Project'>
16+
<Route index element={<Home />} />
17+
<Route path="*" element={<NotFound />} />
18+
</Route>
1319
</Routes>
1420
</ThemeProvider>
1521
)

src/index.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@
5858
body {
5959
@apply bg-background text-foreground;
6060
}
61+
#root {
62+
@apply h-screen w-screen flex flex-col
63+
}
6164
}
6265
@layer components {
6366
.focusing {

src/pages/404.jsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
function NotFound() {
3+
4+
return (
5+
<div className="flex items-center justify-center flex-1 space-x-4">
6+
<div className="text-4xl font-bold border-r-2 border-primary pr-4 font-mono">
7+
404
8+
</div>
9+
<div className="text-lg">
10+
Not Found
11+
</div>
12+
</div>
13+
)
14+
}
15+
16+
export default NotFound;

0 commit comments

Comments
 (0)