Skip to content

Commit eeccbb7

Browse files
added 404 error page (#79)
2 parents ff65860 + b027fd3 commit eeccbb7

File tree

4 files changed

+44
-0
lines changed

4 files changed

+44
-0
lines changed

frontend/src/App.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Home from './components/LandingPage/Pages/Home'
1010
import Contact from './components/LandingPage/Pages/Contact'
1111
import RecycleBin from './components/RecycleBin/RecycleBin';
1212
import Account from './components/Account/Account';
13+
import ErrorPage from './components/Error/ErrorPage';
1314

1415
function App() {
1516
return (
@@ -25,6 +26,7 @@ function App() {
2526
<Route path = "/" element = {<Home />}/>
2627
<Route path = "/bin" element = {<RecycleBin />}/>
2728
<Route path = "/myaccount" element = {<Account />}/>
29+
<Route path = '*' element={<ErrorPage/>}/>
2830
</Routes>
2931
</Router>
3032
);

frontend/src/assets/error404.png

50.5 KB
Loading
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.errorpage_container{
2+
display: flex;
3+
flex-direction: column;
4+
align-items: center;
5+
justify-content: center;
6+
margin: 1rem;
7+
}
8+
9+
.error_banner{
10+
width: 35rem;
11+
}
12+
13+
.errorpage_container h2{
14+
text-align: center;
15+
font-size: 3rem;
16+
}
17+
18+
.errorpage_container p{
19+
font-size: 1.4rem;
20+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from 'react'
2+
import Navbar from '../LandingPage/Components/NavBar/NavBar'
3+
import Footer from '../LandingPage/Components/Footer/Footer'
4+
import './ErrorPage.css'
5+
import errorImg from '..//../assets/error404.png'
6+
import {Link} from 'react-router-dom'
7+
8+
const ErrorPage = () => {
9+
return (
10+
<>
11+
<Navbar/>
12+
<div className='errorpage_container'>
13+
<img className="error_banner" src={errorImg} alt="404 error image" />
14+
<h2>404 Error<br/> Page Not Found!</h2>
15+
<p>Go back to <Link to="/">Home</Link></p>
16+
</div>
17+
<Footer/>
18+
</>
19+
)
20+
}
21+
22+
export default ErrorPage

0 commit comments

Comments
 (0)