1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-24 19:10:22 +01:00
metamask-extension/ui/app/components/loading-screen/loading-screen.component.js

36 lines
824 B
JavaScript
Raw Normal View History

const { Component } = require('react')
const h = require('react-hyperscript')
const PropTypes = require('prop-types')
2018-04-18 09:56:52 +02:00
const classnames = require('classnames')
2018-05-01 03:28:34 +02:00
const Spinner = require('../spinner')
2018-05-01 03:28:34 +02:00
class LoadingScreen extends Component {
renderMessage () {
const { loadingMessage } = this.props
return loadingMessage && h('span', loadingMessage)
}
render () {
return (
2018-04-18 09:56:52 +02:00
h('.loading-overlay', {
className: classnames({ 'loading-overlay--full-screen': this.props.fullScreen }),
}, [
2018-05-01 03:28:34 +02:00
h('.loading-overlay__container', [
h(Spinner, {
color: '#F7C06C',
2018-04-18 09:56:52 +02:00
}),
2018-04-18 09:56:52 +02:00
this.renderMessage(),
]),
])
)
}
}
2018-05-01 03:28:34 +02:00
LoadingScreen.propTypes = {
2017-11-02 03:30:33 +01:00
loadingMessage: PropTypes.string,
2018-04-18 09:56:52 +02:00
fullScreen: PropTypes.bool,
2017-11-02 03:30:33 +01:00
}
2018-05-01 03:28:34 +02:00
module.exports = LoadingScreen