import React from 'react'; import { connect } from 'react-redux'; import { loadConfig } from '../actions/config'; class App extends React.Component { constructor(props) { super(props); } componentDidMount() { this.props.dispatch(loadConfig()); } configError(config) { return

Error loading the CMS configuration

The "config.yml" file could not be loaded or failed to parse properly.

Error message: {config.get('error')}

; } configLoading() { return

Loading configuration...

; } render() { const { config, children } = this.props; if (config === null) { return null; } if (config.get('error')) { return this.configError(config); } if (config.get('isFetching')) { return this.configLoading(); } return (
{children}
); } } function mapStateToProps(state) { return { config: state.config }; } export default connect(mapStateToProps)(App);