You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
680 B

  1. import { connect } from 'react-redux';
  2. import { injectIntl } from 'react-intl';
  3. import { fetchTrends } from '../../../actions/trends';
  4. import Trends from '../components/trends';
  5. import { changeSetting } from '../../../actions/settings';
  6. const mapStateToProps = state => ({
  7. trends: state.getIn(['trends', 'items']),
  8. loading: state.getIn(['trends', 'isLoading']),
  9. showTrends: state.getIn(['settings', 'trends', 'show']),
  10. });
  11. const mapDispatchToProps = dispatch => ({
  12. fetchTrends: () => dispatch(fetchTrends()),
  13. toggleTrends: show => dispatch(changeSetting(['trends', 'show'], show)),
  14. });
  15. export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(Trends));