2017-01-17 13:40:59 +01:00
|
|
|
/*
|
|
|
|
* HomePage
|
|
|
|
*/
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { createStructuredSelector } from 'reselect';
|
|
|
|
import Container from 'components/Container';
|
2017-01-18 11:59:46 +01:00
|
|
|
import { injectIntl } from 'react-intl';
|
2017-01-17 13:40:59 +01:00
|
|
|
|
|
|
|
import {
|
2017-01-18 11:59:46 +01:00
|
|
|
defaultLoad,
|
2017-01-17 13:40:59 +01:00
|
|
|
} from './actions';
|
|
|
|
|
2017-01-18 11:59:46 +01:00
|
|
|
import {
|
|
|
|
selectName
|
|
|
|
} from './selectors';
|
2017-01-17 13:40:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
export class HomePage extends React.Component {
|
|
|
|
|
|
|
|
componentDidMount() {
|
2017-01-18 11:59:46 +01:00
|
|
|
this.props.onDefault();
|
2017-01-17 13:40:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<div className="container">
|
2017-01-18 11:59:46 +01:00
|
|
|
// <PluginHeader {...this.props}></PluginHeader>
|
2017-01-17 13:40:59 +01:00
|
|
|
<Container>
|
2017-01-18 11:59:46 +01:00
|
|
|
{this.props.name}
|
2017-01-17 13:40:59 +01:00
|
|
|
</Container>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-18 11:59:46 +01:00
|
|
|
HomePage.propTypes = {};
|
2017-01-17 13:40:59 +01:00
|
|
|
|
|
|
|
export function mapDispatchToProps(dispatch) {
|
|
|
|
return {
|
2017-01-18 11:59:46 +01:00
|
|
|
onDefault: () => dispatch(defaultLoad()),
|
2017-01-17 13:40:59 +01:00
|
|
|
dispatch,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
const mapStateToProps = createStructuredSelector({
|
2017-01-18 11:59:46 +01:00
|
|
|
name: selectName()
|
2017-01-17 13:40:59 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
// Wrap the component to inject dispatch and state into it
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(injectIntl(HomePage));
|