File tree Expand file tree Collapse file tree 2 files changed +41
-3
lines changed Expand file tree Collapse file tree 2 files changed +41
-3
lines changed Original file line number Diff line number Diff line change
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 ;
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
- import { Route } from 'react-router-dom' ;
2
+ import { Route , Switch } from 'react-router-dom' ;
3
3
import Home from '../home' ;
4
4
import About from '../about' ;
5
+ import e404 from '../404' ;
5
6
import Header from '../../components/header' ;
6
7
import Footer from '../../components/footer' ;
7
8
8
9
const App = ( ) => (
9
10
< div >
10
11
< 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 >
13
17
< Footer />
14
18
</ div >
15
19
) ;
You can’t perform that action at this time.
0 commit comments