Global loader

This commit is contained in:
James Barnsley
2017-03-27 14:23:38 +13:00
parent b7f3eb4c14
commit 76f262fd33
11 changed files with 181 additions and 51 deletions

35
src/js/components/Loader.js Executable file
View File

@ -0,0 +1,35 @@
import React, { PropTypes } from 'react'
import FontAwesome from 'react-fontawesome'
export default class Loader extends React.Component{
constructor(props) {
super(props)
}
render(){
if (!this.props.load_queue){
return null
}
var load_queue = this.props.load_queue
var is_loading = false
for (var key in load_queue){
if (load_queue.hasOwnProperty(key)){
is_loading = true
break
}
}
if (is_loading){
return (
<div className="loader active"></div>
)
} else {
return (
<div className="loader"></div>
)
}
}
}