import CSSTransitionGroup from 'react-addons-css-transition-group'; import React from 'react'; import EventTypes from '../../constants/EventTypes'; import LoadingIndicator from '../ui/LoadingIndicator'; import UIStore from '../../stores/UIStore'; const METHODS_TO_BIND = ['handleUIDependenciesLoaded']; class ApplicationLoadingIndicator extends React.Component { constructor() { super(); this.state = { dependenciesLoaded: false }; METHODS_TO_BIND.forEach((method) => { this[method] = this[method].bind(this); }); } componentDidMount() { UIStore.listen(EventTypes.UI_DEPENDENCIES_LOADED, this.handleUIDependenciesLoaded); } handleUIDependenciesLoaded() { this.setState({dependenciesLoaded: true}); } render() { let content; if (!this.state.dependenciesLoaded) { content = (
); } return ( {content} ); } } export default ApplicationLoadingIndicator;