-
Notifications
You must be signed in to change notification settings - Fork 1
/
loading.js
40 lines (35 loc) · 901 Bytes
/
loading.js
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
38
39
40
import React from 'react'
import PropTypes from 'prop-types'
import './styles.css'
class Loading extends React.Component {
render() {
const backgroundColor = {
background: this.props.background
}
const loaderColor = {
background: this.props.loaderColor
}
if (this.props.loading) {
return (
<div className="loading-background" style={backgroundColor}>
<div className="loading-bar" >
<div className="loading-circle-1" style={loaderColor} />
<div className="loading-circle-2" style={loaderColor} />
</div>
</div>
)
}
return null
}
}
Loading.defaultProps = {
loading: false,
background: 'rgba(236, 240, 241, 0.7)',
loaderColor: '#e74c3c'
}
Loading.propTypes = {
loading: PropTypes.bool,
background: PropTypes.string,
loaderColor: PropTypes.string
}
export default Loading