1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 09:50:31 +01:00
onion/js/components/error_not_found_page.js

47 lines
1.1 KiB
JavaScript
Raw Normal View History

import React from 'react';
import history from '../history';
import { getLangText } from '../utils/lang';
2015-09-30 11:06:42 +02:00
const ErrorNotFoundPage = React.createClass({
propTypes: {
message: React.PropTypes.string,
},
getDefaultProps() {
return {
2015-12-07 11:48:28 +01:00
message: getLangText("Oops, the page you are looking for doesn't exist.")
};
},
2016-02-05 10:38:59 +01:00
componentDidMount() {
// The previous page, if any, is the second item in the locationQueue
const { locationQueue: [, previousPage] } = history;
2016-02-05 10:38:59 +01:00
if (previousPage) {
console.logGlobal('Page not found', {
previousPath: previousPage.pathname
});
}
},
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>
{this.props.message}
2015-09-30 10:44:38 +02:00
</p>
</div>
</div>
</div>
);
}
});
export default ErrorNotFoundPage;