2018-06-01 12:22:42 +00:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { injectIntl } from 'react-intl';
|
|
|
|
import { fetchTrends } from '../../../actions/trends';
|
|
|
|
import Trends from '../components/trends';
|
2018-06-01 17:18:37 +00:00
|
|
|
import { changeSetting } from '../../../actions/settings';
|
2018-06-01 12:22:42 +00:00
|
|
|
|
|
|
|
const mapStateToProps = state => ({
|
|
|
|
trends: state.getIn(['trends', 'items']),
|
|
|
|
loading: state.getIn(['trends', 'isLoading']),
|
2018-06-01 17:18:37 +00:00
|
|
|
showTrends: state.getIn(['settings', 'trends', 'show']),
|
2018-06-01 12:22:42 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
const mapDispatchToProps = dispatch => ({
|
|
|
|
fetchTrends: () => dispatch(fetchTrends()),
|
2018-06-01 17:18:37 +00:00
|
|
|
toggleTrends: show => dispatch(changeSetting(['trends', 'show'], show)),
|
2018-06-01 12:22:42 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(Trends));
|