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
|
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { observer } from 'mobx-react';
import { defineMessages, intlShape } from 'react-intl';
import Button from '../../ui/Button';
const messages = defineMessages({
headline: {
id: 'service.disabledHandler.headline',
defaultMessage: '!!!{name} is disabled',
},
action: {
id: 'service.disabledHandler.action',
defaultMessage: '!!!Enable {name}',
},
});
export default @observer class ServiceDisabled extends Component {
static propTypes = {
name: PropTypes.string.isRequired,
enable: PropTypes.func.isRequired,
};
static contextTypes = {
intl: intlShape,
};
countdownInterval = null;
countdownIntervalTimeout = 1000;
render() {
const { name, enable } = this.props;
const { intl } = this.context;
return (
<div className="services__info-layer">
<h1>{intl.formatMessage(messages.headline, { name })}</h1>
<Button
label={intl.formatMessage(messages.action, { name })}
buttonType="inverted"
onClick={() => enable()}
/>
</div>
);
}
}
|