2015-09-29 16:00:58 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
import React from 'react';
|
2016-02-05 10:38:59 +01:00
|
|
|
import { History } from 'react-router';
|
2015-09-29 16:00:58 +02:00
|
|
|
|
2015-09-30 11:06:42 +02:00
|
|
|
import { getLangText } from '../utils/lang_utils';
|
|
|
|
|
2015-09-29 16:00:58 +02:00
|
|
|
|
|
|
|
let ErrorNotFoundPage = React.createClass({
|
2015-11-30 18:23:03 +01:00
|
|
|
propTypes: {
|
2016-01-11 12:54:15 +01:00
|
|
|
message: React.PropTypes.string,
|
|
|
|
|
|
|
|
// Provided from AscribeApp
|
|
|
|
currentUser: React.PropTypes.object,
|
|
|
|
whitelabel: React.PropTypes.object,
|
|
|
|
|
2016-01-11 16:26:36 +01:00
|
|
|
// Provided from router
|
2016-01-11 12:54:15 +01:00
|
|
|
location: React.PropTypes.object
|
2015-11-30 18:23:03 +01:00
|
|
|
},
|
|
|
|
|
2016-02-05 10:38:59 +01:00
|
|
|
mixins: [History],
|
|
|
|
|
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
|
|
|
|
const { locationQueue: [ , previousPage ] } = this.history;
|
|
|
|
|
|
|
|
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;
|