-
Notifications
You must be signed in to change notification settings - Fork 347
Expand file tree
/
Copy path404.js
More file actions
57 lines (46 loc) · 1.45 KB
/
Copy path404.js
File metadata and controls
57 lines (46 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import React, { Component } from 'react';
import Arrow from '../components/Arrow/Arrow';
import Element from '../components/Element/Element';
import Footer from '../components/Footer/Footer';
import Layout from '../components/layout';
import SEO from '../components/seo';
import colors from '../colors';
class NotFoundPage extends Component {
state = {
siteLanguage: 'fi',
};
componentDidMount() {
const siteLanguage =
window.location.pathname.indexOf('/en') !== -1 ? 'en' : 'fi';
this.setState({ siteLanguage });
}
render() {
const title =
this.state.siteLanguage === 'en' ? 'Page not found' : 'Sivua ei löytynyt';
return (
<Layout>
<SEO
title={`${title} | Full Stack Open 2019`}
lang={this.state.siteLanguage}
/>
<Element className="container spacing--large spacing--after">
<h1>404 - {title}</h1>
<p className="col-10 spacing--small spacing--after">
Uncaught ReferenceError: unknown is not defined
</p>
<Arrow
className="col-10 arrow__container--with-link"
bold
thickBorder
link={this.state.siteLanguage === 'en' ? '/en' : '/'}
content={[
{ backgroundColor: colors['main'], text: 'Go back home' },
]}
/>
</Element>
<Footer lang={this.state.siteLanguage} />
</Layout>
);
}
}
export default NotFoundPage;