Skip to content

Commit

Permalink
Added a custom 404 not found page
Browse files Browse the repository at this point in the history
  • Loading branch information
parthrc committed Oct 12, 2023
1 parent 0bd50c4 commit c19749d
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 26 deletions.
55 changes: 29 additions & 26 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import Homepage from "./pages/Homepage";
import Navbar from "./components/Navbar";
import Team from "./pages/Team"
import Contacts from "./pages/Contacts"
import Team from "./pages/Team";
import Contacts from "./pages/Contacts";
import About from "./pages/AboutOrg";
import Buiding from "./pages/Buiding";
import ReactDOM from "react-dom/client";
Expand All @@ -11,8 +11,8 @@ import Faqs from "./pages/Faqs";
import Resources from "./pages/Resources";
import Privacy from "./pages/Privacy";
import Frontends from "./pages/FrontEnds";
import HTMLCSS from "./pages/Frontend/HTMLCSS"
import JS from "./pages/Frontend/JSc"
import HTMLCSS from "./pages/Frontend/HTMLCSS";
import JS from "./pages/Frontend/JSc";
import Eletron from "./pages/Frontend/Eletron";
import Reactjs from "./pages/Frontend/Reactjs";
import Next__js from "./pages/Frontend/Next__js";
Expand All @@ -24,42 +24,45 @@ import Three__js from "./pages/Frontend/Three__js";
// import About from './components/About'
// import AboutOrg from "./pages/AboutOrg";
import { BrowserRouter, Routes, Route } from "react-router-dom";
import PageNotFound from "./pages/PageNotFound";

const root = ReactDOM.createRoot(document.getElementById('root'));
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(<App />);

function App() {
return (
return (
<BrowserRouter>
<Routes>
<Route path="/" element={<Homepage />}></Route>
<Route path="/team" element={<Team />}></Route>
<Route path="/contact" element={<Contacts/>}></Route>
<Route path="/about" element={<About/>}></Route>
<Route path="/building" element={<Buiding/>}></Route>
<Route path="/guide" element={<Guide/>}></Route>
<Route path="/faq" element={<Faqs/>}></Route>
<Route path="/resource" element={<Resources/>}></Route>
<Route path="/privacypolicy" element={<Privacy/>}></Route>
<Route path="/frontend" element={<Frontends/>}></Route>
<Route path="/html_css" element={<HTMLCSS/>}></Route>
<Route path="/javascript" element={<JS/>}></Route>
<Route path="/electron" element={<Eletron/>}></Route>
<Route path="/reactjs" element={<Reactjs/>}></Route>
<Route path="/nextjs" element={<Next__js/>}></Route>
<Route path="/tailwind" element={<Tail_wind/>}></Route>
<Route path="/vuejs" element={<Vue__js/>}></Route>
<Route path="/threejs" element={<Three__js/>}></Route>
<Route path="/reactnative" element={<React__native/>}></Route>
<Route path="/contact" element={<Contacts />}></Route>
<Route path="/about" element={<About />}></Route>
<Route path="/building" element={<Buiding />}></Route>
<Route path="/guide" element={<Guide />}></Route>
<Route path="/faq" element={<Faqs />}></Route>
<Route path="/resource" element={<Resources />}></Route>
<Route path="/privacypolicy" element={<Privacy />}></Route>
<Route path="/frontend" element={<Frontends />}></Route>
<Route path="/html_css" element={<HTMLCSS />}></Route>
<Route path="/javascript" element={<JS />}></Route>
<Route path="/electron" element={<Eletron />}></Route>
<Route path="/reactjs" element={<Reactjs />}></Route>
<Route path="/nextjs" element={<Next__js />}></Route>
<Route path="/tailwind" element={<Tail_wind />}></Route>
<Route path="/vuejs" element={<Vue__js />}></Route>
<Route path="/threejs" element={<Three__js />}></Route>
<Route path="/reactnative" element={<React__native />}></Route>
<Route path="*" element={<PageNotFound />}></Route>
</Routes>
</BrowserRouter>
);
}

export default App;


{/* <Navbar />
{

Check notice on line 63 in src/App.jsx

View check run for this annotation

codefactor.io / CodeFactor

src/App.jsx#L63

Block is redundant. (no-lone-blocks)
/* <Navbar />
<Hero />
<About />
<Newsletter/> */}
<Newsletter/> */
}
Binary file added src/assets/img/page_not_found_img/404-error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions src/pages/PageNotFound.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Link } from "react-router-dom";

function PageNotFound() {
return (
<div className="flex text-white flex-col items-center justify-center p-10">
<img
className="w-96 mx-auto "
src="src\assets\img\page_not_found_img\404-error.png"

Check notice on line 8 in src/pages/PageNotFound.jsx

View check run for this annotation

codefactor.io / CodeFactor

src/pages/PageNotFound.jsx#L8

Don't use octal: '\40'. Use '\u....' instead. (no-octal-escape)
alt="404-page-not-found"
/>
<p className="font-bold md:text-3xl sm:text-2xl text-xl p-4 text-white">
Sorry the page you are looking for does not exist.
</p>
<button className="hover:bg-green-800 bg-[#0dff1c] w-[190px] h-[60px] rounded-md font-medium my-4 py-3 text-black">
<button>
<Link to="/">GO BACK HOME</Link>
</button>
</button>
</div>
);
}

export default PageNotFound;

0 comments on commit c19749d

Please sign in to comment.