Skip to content

Commit ee1b879

Browse files
author
David Silva
committed
added 404 page
1 parent 9786ede commit ee1b879

File tree

2 files changed

+41
-3
lines changed

2 files changed

+41
-3
lines changed

src/containers/404/index.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import React from 'react';
2+
import { Link } from 'react-router-dom';
3+
import corgi404 from '../../images/404corgi.png';
4+
import blueBg from '../../images/blue-bg.jpg';
5+
6+
class e404 extends React.Component {
7+
render() {
8+
return(
9+
<main>
10+
<section id="hero" className="dark-bg img-bg img-bg-soft" style={{ backgroundImage: `url(${blueBg})` }}>
11+
<div className="container inner-top-md inner-bottom-sm">
12+
<div className="row">
13+
<div className="col-md-5 inner-right inner-bottom-xs">
14+
<header>
15+
<h1>404 - Not found</h1>
16+
<p>We couldn't find the page you requested, but we found this cute corgi.
17+
</p>
18+
</header>
19+
</div>
20+
<div className="col-md-7">
21+
<div>
22+
<img src={corgi404} alt="404 corgi" />
23+
</div>
24+
<Link to="/" className="btn btn-large">Homepage</Link>
25+
</div>
26+
</div>
27+
</div>
28+
</section>
29+
</main>
30+
);
31+
}
32+
}
33+
34+
export default e404;

src/containers/app/index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
import React from 'react';
2-
import { Route } from 'react-router-dom';
2+
import { Route, Switch } from 'react-router-dom';
33
import Home from '../home';
44
import About from '../about';
5+
import e404 from '../404';
56
import Header from '../../components/header';
67
import Footer from '../../components/footer';
78

89
const App = () => (
910
<div>
1011
<Header />
11-
<Route exact path="/" component={Home} />
12-
<Route exact path="/about" component={About} />
12+
<Switch>
13+
<Route exact path="/" component={Home} />
14+
<Route path="/about" component={About} />
15+
<Route component={e404} />
16+
</Switch>
1317
<Footer />
1418
</div>
1519
);

0 commit comments

Comments
 (0)