Skip to content

Commit

Permalink
Add NotFound page
Browse files Browse the repository at this point in the history
  • Loading branch information
Mustapha-Nkhili committed Jul 23, 2024
1 parent a07c40c commit c0d1094
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ import Resize from "./pages/docs/Interactivity/Resize";
import ScrollBehavior from "./pages/docs/Interactivity/ScrollBehavior";
import UserSelect from "./pages/docs/Interactivity/UserSelect";
import WillChange from "./pages/docs/Interactivity/WillChange";
import NotFound from "./pages/NotFound";

import "./app.css";

Expand Down Expand Up @@ -603,6 +604,10 @@ function App() {
},
],
},
{
path: "*",
element: <NotFound />,
},
]);
return <RouterProvider router={router} />;
}
Expand Down
23 changes: 23 additions & 0 deletions src/pages/NotFound.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { useEffect } from "react";
import { Link } from "react-router-dom";

const NotFound = () => {
useEffect(() => {
document.getElementsByTagName("title")[0].innerText = "404 - Nkhili CSS";
}, []);

return (
<div className="flex justify-center items-center flex-column h-screen capitalize gap-10">
<h1 className="text-9xl text-white">404</h1>
<span className="text-light-periwinkle">page not found</span>
<Link
className="px-4 text-black py-2 bg-primary rounded font-medium"
to="/"
>
go home
</Link>
</div>
);
};

export default NotFound;

0 comments on commit c0d1094

Please sign in to comment.