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.
45 lines
1.0 KiB
45 lines
1.0 KiB
9 years ago
|
const inherits = require('util').inherits
|
||
|
const Component = require('react').Component
|
||
|
const h = require('react-hyperscript')
|
||
|
const ReactCSSTransitionGroup = require('react-addons-css-transition-group')
|
||
|
|
||
|
|
||
|
inherits(LoadingIndicator, Component)
|
||
8 years ago
|
module.exports = LoadingIndicator
|
||
|
|
||
8 years ago
|
function LoadingIndicator () {
|
||
9 years ago
|
Component.call(this)
|
||
|
}
|
||
|
|
||
8 years ago
|
LoadingIndicator.prototype.render = function () {
|
||
9 years ago
|
var isLoading = this.props.isLoading
|
||
|
|
||
|
return (
|
||
|
h(ReactCSSTransitionGroup, {
|
||
9 years ago
|
className: 'css-transition-group',
|
||
|
transitionName: 'loader',
|
||
9 years ago
|
transitionEnterTimeout: 150,
|
||
|
transitionLeaveTimeout: 150,
|
||
|
}, [
|
||
|
|
||
|
isLoading ? h('div', {
|
||
|
style: {
|
||
8 years ago
|
zIndex: 10,
|
||
9 years ago
|
position: 'absolute',
|
||
|
display: 'flex',
|
||
|
justifyContent: 'center',
|
||
|
alignItems: 'center',
|
||
|
height: '100%',
|
||
|
width: '100%',
|
||
|
background: 'rgba(255, 255, 255, 0.5)',
|
||
8 years ago
|
},
|
||
9 years ago
|
}, [
|
||
|
h('img', {
|
||
|
src: 'images/loading.svg',
|
||
|
}),
|
||
|
]) : null,
|
||
|
])
|
||
|
)
|
||
|
}
|
||
|
|