-
Notifications
You must be signed in to change notification settings - Fork 295
/
NotResponding.tsx
90 lines (86 loc) · 3.23 KB
/
NotResponding.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// @flow
import React, { Component } from 'react';
import SVGInline from 'react-svg-inline';
import { defineMessages, intlShape, FormattedHTMLMessage } from 'react-intl';
import { Button } from 'react-polymorph/lib/components/Button';
import { ButtonSkin } from 'react-polymorph/lib/skins/simple/ButtonSkin';
import { Link } from 'react-polymorph/lib/components/Link';
import { LinkSkin } from 'react-polymorph/lib/skins/simple/LinkSkin';
import icon from '../../../assets/images/not-responding.inline.svg';
import styles from './NotResponding.scss';
type Props = {
walletName: string,
onRestartNode: Function,
onOpenExternalLink: Function,
};
const messages = defineMessages({
title: {
id: 'wallet.notResponding.title',
defaultMessage: '!!!The wallet is not responding.',
description: 'Title on the NotResponding dialog.',
},
description: {
id: 'wallet.notResponding.description',
defaultMessage:
'!!!The {walletName} wallet is not responding. This is caused by a known but rare issue, which is currently being fixed. Please restart the Cardano node by clicking the button below, which should resolve the issue. If the issue persists, or if it happens again, please submit a support request.',
description: 'Description on the NotResponding dialog.',
},
restartNodeButtonLabel: {
id: 'wallet.notResponding.restartNodeButtonLabel',
defaultMessage: '!!!Restart Cardano Node',
description: 'Restart Node Button Label on the NotResponding dialog.',
},
submitSupportRequestLabel: {
id: 'wallet.notResponding.submitSupportRequestLabel',
defaultMessage: '!!!Submit a support request',
description: 'Submit Support Request Label on the NotResponding dialog',
},
submitSupportRequestUrl: {
id: 'wallet.notResponding.submitSupportRequestUrl',
defaultMessage: '!!!https://iohk.zendesk.com/hc/en-us/requests/new/',
description: 'Submit Support Request Url on the NotResponding dialog',
},
});
export default class NotResponding extends Component<Props> {
static contextTypes = {
intl: intlShape.isRequired,
};
render() {
const { intl } = this.context;
const { walletName, onRestartNode, onOpenExternalLink } = this.props;
return (
<div className={styles.component}>
<div className={styles.content}>
<SVGInline svg={icon} className={styles.icon} />
<div className={styles.title}>
{intl.formatMessage(messages.title)}
</div>
<div className={styles.description}>
<FormattedHTMLMessage
{...messages.description}
values={{
walletName,
}}
/>
</div>
<Button
className={styles.restartNodeButton}
label={intl.formatMessage(messages.restartNodeButtonLabel)}
onClick={onRestartNode}
skin={ButtonSkin}
/>
<Link
className={styles.submitSupportLink}
onClick={() =>
onOpenExternalLink(
intl.formatMessage(messages.submitSupportRequestUrl)
)
}
label={intl.formatMessage(messages.submitSupportRequestLabel)}
skin={LinkSkin}
/>
</div>
</div>
);
}
}