You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
824 B
36 lines
824 B
7 years ago
|
const { Component } = require('react')
|
||
9 years ago
|
const h = require('react-hyperscript')
|
||
7 years ago
|
const PropTypes = require('prop-types')
|
||
7 years ago
|
const classnames = require('classnames')
|
||
7 years ago
|
const Spinner = require('../spinner')
|
||
9 years ago
|
|
||
7 years ago
|
class LoadingScreen extends Component {
|
||
7 years ago
|
renderMessage () {
|
||
|
const { loadingMessage } = this.props
|
||
|
return loadingMessage && h('span', loadingMessage)
|
||
|
}
|
||
|
|
||
|
render () {
|
||
|
return (
|
||
7 years ago
|
h('.loading-overlay', {
|
||
|
className: classnames({ 'loading-overlay--full-screen': this.props.fullScreen }),
|
||
|
}, [
|
||
7 years ago
|
h('.loading-overlay__container', [
|
||
|
h(Spinner, {
|
||
|
color: '#F7C06C',
|
||
7 years ago
|
}),
|
||
7 years ago
|
|
||
7 years ago
|
this.renderMessage(),
|
||
|
]),
|
||
7 years ago
|
])
|
||
|
)
|
||
|
}
|
||
9 years ago
|
}
|
||
|
|
||
7 years ago
|
LoadingScreen.propTypes = {
|
||
7 years ago
|
loadingMessage: PropTypes.string,
|
||
7 years ago
|
fullScreen: PropTypes.bool,
|
||
7 years ago
|
}
|
||
|
|
||
7 years ago
|
module.exports = LoadingScreen
|