Skip to content

Commit

Permalink
Merge pull request #43 from AaadityaG/404page
Browse files Browse the repository at this point in the history
Add: 404 page
  • Loading branch information
MonalikaPatnaik authored Dec 26, 2023
2 parents e2c6110 + d0359ec commit 6e9031c
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Contact from "./pages/Contact"
import ExploreProducts from "./pages/ExploreProducts";
import OpenStore from "./pages/OpenStore";
import CreateItem from "./pages/CreateItem";
import ErrorPage from "./components/ErrorPage";


// import SingleBlog from "./pages/SingleBlog
Expand Down Expand Up @@ -65,6 +66,9 @@ function App() {
<Route path="blog/:id" element={<SingleBlog />} />


</Route>
<Route path="/*" element={<ErrorPage/>}>

</Route>
</Routes>
</BrowserRouter>
Expand Down
45 changes: 45 additions & 0 deletions client/src/components/ErrorPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import React from 'react';
import { Link } from 'react-router-dom'; // If you're using React Router

const ErrorPage = () => {
const pageStyle = {
backgroundColor: '#C4A1D4',
minHeight: '100vh',
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
padding: '20px',
};

const textStyle = {
color: '#010101',
textAlign: 'center',
marginBottom: '20px',
};

const buttonStyle = {
marginTop: '50px',
backgroundColor: '#ffe9cc',
color: '#010101',
padding: '10px 20px',
borderRadius: '5px',
textDecoration: 'none',
};

const h1Style = {
fontSize: "100px",
}

return (
<div style={pageStyle}>
<h1 style={h1Style}>404</h1>
<p style={textStyle}>Sorry, your page is not found!</p>
<Link to="/" style={buttonStyle}>
Go back
</Link>
</div>
);
};

export default ErrorPage;

0 comments on commit 6e9031c

Please sign in to comment.