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.

34 lines
1003 B

  1. import { connect } from 'react-redux';
  2. import StatusList from '../../../components/status_list';
  3. import { replyCompose } from '../../../actions/compose';
  4. import { reblog, favourite } from '../../../actions/interactions';
  5. import { expandTimeline } from '../../../actions/timelines';
  6. import { selectStatus } from '../../../reducers/timelines';
  7. const mapStateToProps = function (state, props) {
  8. return {
  9. statuses: state.getIn(['timelines', props.type]).map(id => selectStatus(state, id))
  10. };
  11. };
  12. const mapDispatchToProps = function (dispatch, props) {
  13. return {
  14. onReply: function (status) {
  15. dispatch(replyCompose(status));
  16. },
  17. onFavourite: function (status) {
  18. dispatch(favourite(status));
  19. },
  20. onReblog: function (status) {
  21. dispatch(reblog(status));
  22. },
  23. onScrollToBottom: function () {
  24. dispatch(expandTimeline(props.type));
  25. }
  26. };
  27. };
  28. export default connect(mapStateToProps, mapDispatchToProps)(StatusList);