2019-05-17 14:21:07 -04:00
|
|
|
import { connect } from 'react-redux';
|
2020-06-23 13:38:18 -04:00
|
|
|
import { makeSelectClaimIsMine, selectMyChannelClaims } from 'lbry-redux';
|
|
|
|
import { makeSelectCommentsForUri, selectIsFetchingComments } from 'redux/selectors/comments';
|
|
|
|
import { doCommentList } from 'redux/actions/comments';
|
2019-05-17 14:21:07 -04:00
|
|
|
import CommentsList from './view';
|
|
|
|
|
|
|
|
const select = (state, props) => ({
|
2020-01-29 20:02:21 -05:00
|
|
|
myChannels: selectMyChannelClaims(state),
|
2019-05-17 14:21:07 -04:00
|
|
|
comments: makeSelectCommentsForUri(props.uri)(state),
|
2020-01-29 20:02:21 -05:00
|
|
|
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
|
2020-05-25 14:45:43 -04:00
|
|
|
isFetchingComments: selectIsFetchingComments(state),
|
2019-05-17 14:21:07 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
const perform = dispatch => ({
|
2019-06-26 19:59:27 -04:00
|
|
|
fetchComments: uri => dispatch(doCommentList(uri)),
|
2019-05-17 14:21:07 -04:00
|
|
|
});
|
2019-06-26 19:59:27 -04:00
|
|
|
|
2020-01-29 20:02:21 -05:00
|
|
|
export default connect(select, perform)(CommentsList);
|