-
Notifications
You must be signed in to change notification settings - Fork 295
/
RestoreNotification.tsx
51 lines (45 loc) · 1.47 KB
/
RestoreNotification.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
// @flow
import React, { Component } from 'react';
import classnames from 'classnames';
import { observer } from 'mobx-react';
import SVGInline from 'react-svg-inline';
import { defineMessages, intlShape } from 'react-intl';
import spinnerIcon from '../../assets/images/spinner-dark.inline.svg';
import { formattedNumber } from '../../utils/formatters';
import styles from './RestoreNotification.scss';
const messages = defineMessages({
activeRestoreMessage: {
id: 'wallet.statusMessages.activeRestore',
defaultMessage:
'!!!The balance and transaction history of this wallet is {percentage}% synced with the blockchain.',
description:
'Status message "Wallet restore in progress" shown while wallet is being restored.',
},
});
type Props = {
restoreProgress: number,
};
@observer
export default class RestoreNotification extends Component<Props> {
static contextTypes = {
intl: intlShape.isRequired,
};
render() {
const { intl } = this.context;
const { restoreProgress } = this.props;
const restoreNotificationClasses = classnames([
styles.component,
'ActiveRestoreNotification',
]);
return (
<div className={restoreNotificationClasses}>
<span className={styles.text}>
{intl.formatMessage(messages.activeRestoreMessage, {
percentage: formattedNumber(restoreProgress),
})}
</span>
<SVGInline svg={spinnerIcon} className={styles.icon} />
</div>
);
}
}