lbry-desktop/ui/component/commentsList/index.js

21 lines
856 B
JavaScript
Raw Normal View History

2019-05-17 20:21:07 +02:00
import { connect } from 'react-redux';
2020-06-23 19:38:18 +02:00
import { makeSelectClaimIsMine, selectMyChannelClaims } from 'lbry-redux';
2020-08-24 19:35:21 +02:00
import { makeSelectTopLevelCommentsForUri, selectIsFetchingComments } from 'redux/selectors/comments';
2020-06-23 19:38:18 +02:00
import { doCommentList } from 'redux/actions/comments';
2019-05-17 20:21:07 +02:00
import CommentsList from './view';
2020-08-24 19:35:21 +02:00
import { selectUserVerifiedEmail } from 'redux/selectors/user';
2019-05-17 20:21:07 +02:00
const select = (state, props) => ({
myChannels: selectMyChannelClaims(state),
2020-08-24 19:35:21 +02:00
comments: makeSelectTopLevelCommentsForUri(props.uri)(state),
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
isFetchingComments: selectIsFetchingComments(state),
2020-08-24 19:35:21 +02:00
commentingEnabled: IS_WEB ? Boolean(selectUserVerifiedEmail(state)) : true,
2019-05-17 20:21:07 +02:00
});
const perform = dispatch => ({
2019-06-27 01:59:27 +02:00
fetchComments: uri => dispatch(doCommentList(uri)),
2019-05-17 20:21:07 +02:00
});
2019-06-27 01:59:27 +02:00
export default connect(select, perform)(CommentsList);