Skip to content

Commit

Permalink
Merge pull request #141 from harshbhar0629/BUG/Invalid-Path-Edit
Browse files Browse the repository at this point in the history
BUG: Invalid or wrong path route added
  • Loading branch information
skmirajulislam authored Oct 8, 2024
2 parents d98b6e4 + e1a0b1a commit 1cb86f5
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import About from "./pages/About/About.js";
import Loan from "./pages/Loan/Loan.js";
import Dashboard from "./pages/Dashboard/Dashboard.js";
import Contact from "./pages/Contact/Contact.js";
import Error from "./pages/Error/index.js";
function App() {
const location = useLocation();
return (
Expand All @@ -40,6 +41,9 @@ function App() {
<Route path="/login" element={<Login />} />
<Route path="/signup" element={<Signup />} /> {/* Use lowercase for consistency */}
<Route path="/contact" element={<Contact />} />
<Route
path="*"
element={<Error />}></Route>
</Routes>
</main>
{location.pathname !== "/login" && location.pathname.toLowerCase() !== "/signup" && <Footer />} </div>
Expand Down
47 changes: 47 additions & 0 deletions frontend/src/pages/Error/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/** @format */

import React from "react";
import { Link } from "react-router-dom";

const Error = () => {
return (
<section
className="py-5 bg-white"
style={{ paddingTop: "100px" }}>
<div className="container">
<div className="text-center">
<div
className="bg-image"
style={{
height: "400px",
backgroundPosition: "center",
backgroundImage:
"url(https://cdn.dribbble.com/users/285475/screenshots/2083086/dribbble_1.gif)",
}}>
<h1 className="display-4 fw-bold text-black">
404 - Page Not Found !!
</h1>
</div>

<div className="mt-3">
<h3 className="display-6 mb-1 fw-semibold">
Looks like you're lost
</h3>

<p className="fw-semibold">
The page you are looking for is not available!
</p>

<Link
to="/"
className="btn btn-success btn-lg my-4">
Home
</Link>
</div>
</div>
</div>
</section>
);
};

export default Error;

0 comments on commit 1cb86f5

Please sign in to comment.