feat: add work in progress 7.0 code

Co-authored-by: Alex Sparkes <turbomarshmello@gmail.com>
This commit is contained in:
David Ralph
2022-04-08 14:48:36 +01:00
parent e0820c6b2a
commit 361fae7f25
136 changed files with 8631 additions and 3500 deletions

View File

@@ -6,27 +6,42 @@ export default class ErrorBoundary extends PureComponent {
constructor(props) {
super(props);
this.state = {
error: false
error: false,
};
}
static getDerivedStateFromError(error) {
console.log(error);
variables.stats.postEvent('modal', 'Error occurred');
return {
error: true
return {
error: true,
};
}
render() {
if (this.state.error) {
return (
<div className='emptyitems'>
<div className='emptyMessage'>
<MdErrorOutline/>
<h1>{variables.language.getMessage(variables.languagecode, 'modals.main.error_boundary.title')}</h1>
<p>{variables.language.getMessage(variables.languagecode, 'modals.main.error_boundary.message')}</p>
<button className='refresh' onClick={() => window.location.reload()}>{variables.language.getMessage(variables.languagecode, 'modals.main.error_boundary.refresh')}</button>
<div className="emptyItems">
<div className="emptyMessage">
<MdErrorOutline />
<h1>
{variables.language.getMessage(
variables.languagecode,
'modals.main.error_boundary.title',
)}
</h1>
<p>
{variables.language.getMessage(
variables.languagecode,
'modals.main.error_boundary.message',
)}
</p>
<button className="refresh" onClick={() => window.location.reload()}>
{variables.language.getMessage(
variables.languagecode,
'modals.main.error_boundary.refresh',
)}
</button>
</div>
</div>
);