58 lines
1.1 KiB
JavaScript
Raw Normal View History

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 styles from './styles.scss';
2017-01-17 13:40:59 +01:00
import {
2017-01-19 16:42:16 +01:00
load,
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 {
2017-01-19 16:42:16 +01:00
componentWillMount() {
this.props.load();
2017-01-17 13:40:59 +01:00
}
render() {
return (
<div>
<div className={`container-fluid ${styles.containerFluid}`}>
2017-01-17 13:40:59 +01:00
<Container>
<p>Nothing to do here.</p>
<p>To edit your content's entries go to the specific link in the left menu.</p>
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-19 16:42:16 +01:00
load: () => {
console.log('dispatch LOAD');
dispatch(load());
}
2017-01-17 13:40:59 +01:00
};
}
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));