aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/ui/WebviewLoader/index.js
blob: 58b6b6f1b38642a52374c291b421652dbc150371 (plain) (blame)
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
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { observer } from 'mobx-react';
import injectSheet from 'react-jss';
import { defineMessages, intlShape } from 'react-intl';

import FullscreenLoader from '../FullscreenLoader';
import styles from './styles';

const messages = defineMessages({
  loading: {
    id: 'service.webviewLoader.loading',
    defaultMessage: '!!!Loading',
  },
});

export default @observer @injectSheet(styles) class WebviewLoader extends Component {
  static propTypes = {
    name: PropTypes.string.isRequired,
    classes: PropTypes.object.isRequired,
  };

  static contextTypes = {
    intl: intlShape,
  };

  render() {
    const { classes, name } = this.props;
    const { intl } = this.context;
    return (
      <FullscreenLoader
        className={classes.component}
        title={`${intl.formatMessage(messages.loading)} ${name}`}
      />
    );
  }
}