{"size": 771, "ext": "js", "max_stars_repo_path": "client/components/App.js", "max_stars_repo_name": "petteripitkanen/powerplant", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "client/components/App.js", "max_issues_repo_name": "petteripitkanen/powerplant", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "client/components/App.js", "max_forks_repo_name": "petteripitkanen/powerplant", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 18.3571428571, "max_line_length": 59, "alphanum_fraction": 0.6277561608}
/**
 * @namespace App
 * @memberof client.components
 */

const React = require('react');
const Header = require('./header/Header');
const Main = require('./Main');
const PropTypes = require('prop-types');
const { connect } = require('react-redux');
const { withRouter } = require('react-router-dom');

/**
 * Represents the main page.
 * 
 * @extends Component
 */
class App extends React.Component {
	render() {
		if (!this.props.storeLoaded) {
			return (<div>Loading...</div>);
		} else {
			return (
				<div>
					<Header />
					<Main />
				</div>
			);
	  	}
	}
}

App.propTypes = {
	storeLoaded: PropTypes.bool.isRequired
};

const mapStateToProps = ({ app }) => ({
	storeLoaded: app.storeLoaded
});

module.exports = withRouter(connect(mapStateToProps)(App));
