aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/loading-screen/loading-screen.component.js
blob: bce2a4aac5baffff925dd99c963e6230a7f0a38d (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
const { Component } = require('react')
const h = require('react-hyperscript')
const PropTypes = require('prop-types')
const classnames = require('classnames')
const Spinner = require('../spinner')

class LoadingScreen extends Component {
  renderMessage () {
    const { loadingMessage } = this.props
    return loadingMessage && h('span', loadingMessage)
  }

  render () {
    return (
      h('.loading-overlay', {
        className: classnames({ 'loading-overlay--full-screen': this.props.fullScreen }),
      }, [
        h('.loading-overlay__container', [
          h(Spinner, {
            color: '#F7C06C',
          }),

          this.renderMessage(),
        ]),
      ])
    )
  }
}

LoadingScreen.propTypes = {
  loadingMessage: PropTypes.string,
  fullScreen: PropTypes.bool,
}

module.exports = LoadingScreen