about summary refs log tree commit diff
path: root/app/assets/javascripts/components/features/ui/containers/status_list_container.jsx
blob: 1621cec7b33ae88eef4a96cb4d8f37afeadb5778 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { connect } from 'react-redux';
import StatusList from '../../../components/status_list';
import { expandTimeline, scrollTopTimeline } from '../../../actions/timelines';
import Immutable from 'immutable';

const mapStateToProps = (state, props) => ({
  statusIds: state.getIn(['timelines', props.type, 'items'], Immutable.List())
});

const mapDispatchToProps = function (dispatch, props) {
  return {
    onScrollToBottom () {
      dispatch(scrollTopTimeline(props.type, false));
      dispatch(expandTimeline(props.type, props.id));
    },

    onScrollToTop () {
      dispatch(scrollTopTimeline(props.type, true));
    },

    onScroll () {
      dispatch(scrollTopTimeline(props.type, false));
    }
  };
};

export default connect(mapStateToProps, mapDispatchToProps)(StatusList);