2020-01-15 23:39:53 +03:00
|
|
|
import React, { ComponentType } from 'react';
|
2016-11-12 02:33:12 +03:00
|
|
|
import { FormattedMessage as Message } from 'react-intl';
|
2020-01-15 23:39:53 +03:00
|
|
|
|
2019-12-07 21:02:00 +02:00
|
|
|
import appInfo from 'app/components/auth/appInfo/AppInfo.intl.json';
|
2016-11-12 02:33:12 +03:00
|
|
|
|
2017-08-09 21:41:35 +03:00
|
|
|
import BoxesField from './BoxesField';
|
2020-01-15 23:39:53 +03:00
|
|
|
|
|
|
|
import styles from './styles.scss';
|
2017-08-09 21:41:35 +03:00
|
|
|
import messages from './BSoD.intl.json';
|
2016-11-12 02:33:12 +03:00
|
|
|
|
2019-12-07 13:28:52 +02:00
|
|
|
interface State {
|
|
|
|
lastEventId?: string | void;
|
|
|
|
}
|
|
|
|
|
2020-01-15 23:39:53 +03:00
|
|
|
interface Props {
|
|
|
|
lastEventId?: string;
|
|
|
|
}
|
2018-05-02 21:22:13 +03:00
|
|
|
|
2020-01-15 23:39:53 +03:00
|
|
|
// TODO: probably it's better to render this view from the App view
|
|
|
|
// to remove dependencies from the store and IntlProvider
|
|
|
|
const BSoD: ComponentType<Props> = ({ lastEventId }) => {
|
|
|
|
let emailUrl = 'mailto:support@ely.by';
|
2018-05-02 21:22:13 +03:00
|
|
|
|
2020-01-15 23:39:53 +03:00
|
|
|
if (lastEventId) {
|
|
|
|
emailUrl += `?subject=Bug report for #${lastEventId}`;
|
2019-11-27 11:03:32 +02:00
|
|
|
}
|
2018-05-02 21:22:13 +03:00
|
|
|
|
2020-01-15 23:39:53 +03:00
|
|
|
return (
|
|
|
|
<div className={styles.body}>
|
|
|
|
<canvas
|
|
|
|
className={styles.canvas}
|
|
|
|
ref={(el: HTMLCanvasElement | null) => el && new BoxesField(el)}
|
|
|
|
/>
|
2018-05-02 21:22:13 +03:00
|
|
|
|
2020-01-15 23:39:53 +03:00
|
|
|
<div className={styles.wrapper}>
|
|
|
|
<div className={styles.title}>
|
|
|
|
<Message {...appInfo.appName} />
|
|
|
|
</div>
|
|
|
|
<div className={styles.lineWithMargin}>
|
|
|
|
<Message {...messages.criticalErrorHappened} />
|
|
|
|
</div>
|
|
|
|
<div className={styles.line}>
|
|
|
|
<Message {...messages.reloadPageOrContactUs} />
|
|
|
|
</div>
|
|
|
|
<a href={emailUrl} className={styles.support}>
|
|
|
|
support@ely.by
|
|
|
|
</a>
|
|
|
|
<div className={styles.easterEgg}>
|
|
|
|
<Message {...messages.alsoYouCanInteractWithBackground} />
|
2019-11-27 11:03:32 +02:00
|
|
|
</div>
|
2019-12-26 14:18:58 +02:00
|
|
|
</div>
|
2020-01-15 23:39:53 +03:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
2019-12-07 13:28:52 +02:00
|
|
|
|
|
|
|
export default BSoD;
|