mirror of
https://github.com/strapi/strapi.git
synced 2025-08-06 15:53:11 +00:00
48 lines
1.1 KiB
JavaScript
48 lines
1.1 KiB
JavaScript
/*
|
|
* HomePage
|
|
*
|
|
* This is the first thing users see of our App, at the '/' route
|
|
*
|
|
* NOTE: while this component should technically be a stateless functional
|
|
* component (SFC), hot reloading does not currently support SFCs. If hot
|
|
* reloading is not a neccessity for you then you can refactor it and remove
|
|
* the linting exception.
|
|
*/
|
|
|
|
import React from 'react';
|
|
import { connect } from 'react-redux';
|
|
import { createSelector } from 'reselect';
|
|
import { selectPlugins } from '../App/selectors';
|
|
import LeftMenu from '../LeftMenu';
|
|
import Content from '../Content';
|
|
|
|
export class HomePage extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
|
|
render() {
|
|
return (
|
|
<div>
|
|
<LeftMenu {...this.props}></LeftMenu>
|
|
<Content></Content>
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
HomePage.propTypes = {
|
|
plugins: React.PropTypes.object,
|
|
onRegisterPluginClicked: React.PropTypes.func,
|
|
};
|
|
|
|
const mapStateToProps = createSelector(
|
|
selectPlugins(),
|
|
(plugins) => ({ plugins })
|
|
);
|
|
|
|
function mapDispatchToProps(dispatch) {
|
|
return {
|
|
dispatch,
|
|
};
|
|
}
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(HomePage);
|