mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Convert LoadingScreen component to use JSX (#7545)
This commit is contained in:
parent
04442318d3
commit
8311617b95
@ -1,31 +1,33 @@
|
||||
const { Component } = require('react')
|
||||
const h = require('react-hyperscript')
|
||||
import React, {Component} from 'react'
|
||||
const PropTypes = require('prop-types')
|
||||
const Spinner = require('../spinner')
|
||||
|
||||
class LoadingScreen extends Component {
|
||||
static defaultProps = {
|
||||
loadingMessage: null,
|
||||
}
|
||||
|
||||
static propTypes = {
|
||||
loadingMessage: PropTypes.string,
|
||||
}
|
||||
|
||||
renderMessage () {
|
||||
const { loadingMessage } = this.props
|
||||
return loadingMessage && h('span', loadingMessage)
|
||||
return loadingMessage
|
||||
? <span>{loadingMessage}</span>
|
||||
: null
|
||||
}
|
||||
|
||||
render () {
|
||||
return (
|
||||
h('.loading-overlay', [
|
||||
h('.loading-overlay__container', [
|
||||
h(Spinner, {
|
||||
color: '#F7C06C',
|
||||
}),
|
||||
|
||||
this.renderMessage(),
|
||||
]),
|
||||
])
|
||||
<div className="loading-overlay">
|
||||
<div className="loading-overlay__container">
|
||||
<Spinner color="#F7C06C" />
|
||||
{this.renderMessage()}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
LoadingScreen.propTypes = {
|
||||
loadingMessage: PropTypes.string,
|
||||
}
|
||||
|
||||
module.exports = LoadingScreen
|
||||
|
Loading…
Reference in New Issue
Block a user