2015-09-29 16:00:58 +02:00
|
|
|
import React from 'react';
|
2016-06-06 15:40:26 +02:00
|
|
|
|
|
|
|
import history from '../history';
|
2015-09-29 16:00:58 +02:00
|
|
|
|
2016-06-13 14:35:02 +02:00
|
|
|
import { getLangText } from '../utils/lang';
|
2015-09-30 11:06:42 +02:00
|
|
|
|
2015-09-29 16:00:58 +02:00
|
|
|
|
2016-06-06 15:40:26 +02:00
|
|
|
const ErrorNotFoundPage = React.createClass({
|
2015-11-30 18:23:03 +01:00
|
|
|
propTypes: {
|
2016-01-11 12:54:15 +01:00
|
|
|
message: React.PropTypes.string,
|
2015-11-30 18:23:03 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
getDefaultProps() {
|
|
|
|
return {
|
2015-12-07 11:48:28 +01:00
|
|
|
message: getLangText("Oops, the page you are looking for doesn't exist.")
|
2015-11-30 18:23:03 +01:00
|
|
|
};
|
|
|
|
},
|
|
|
|
|
2016-02-05 10:38:59 +01:00
|
|
|
componentDidMount() {
|
|
|
|
// The previous page, if any, is the second item in the locationQueue
|
2016-06-06 15:40:26 +02:00
|
|
|
const { locationQueue: [, previousPage] } = history;
|
2016-02-05 10:38:59 +01:00
|
|
|
|
|
|
|
if (previousPage) {
|
|
|
|
console.logGlobal('Page not found', {
|
|
|
|
previousPath: previousPage.pathname
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2015-09-29 16:00:58 +02:00
|
|
|
render() {
|
|
|
|
return (
|
2015-09-30 10:44:38 +02:00
|
|
|
<div className="row">
|
|
|
|
<div className="col-md-12">
|
|
|
|
<div className="error-wrapper">
|
|
|
|
<h1>404</h1>
|
|
|
|
<p>
|
2015-11-30 18:23:03 +01:00
|
|
|
{this.props.message}
|
2015-09-30 10:44:38 +02:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2015-09-29 16:00:58 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2016-01-11 12:54:15 +01:00
|
|
|
export default ErrorNotFoundPage;
|