2020-08-24 13:35:21 -04:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { makeSelectClaimIsMine, selectMyChannelClaims } from 'lbry-redux';
|
2021-07-15 22:43:28 +08:00
|
|
|
import {
|
|
|
|
selectIsFetchingCommentsByParentId,
|
|
|
|
makeSelectRepliesForParentId,
|
|
|
|
makeSelectTotalRepliesForParentId,
|
|
|
|
} from 'redux/selectors/comments';
|
2020-08-24 13:35:21 -04:00
|
|
|
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
2020-08-25 15:54:06 -04:00
|
|
|
import CommentsReplies from './view';
|
2020-08-24 13:35:21 -04:00
|
|
|
|
|
|
|
const select = (state, props) => ({
|
2021-07-15 22:43:28 +08:00
|
|
|
fetchedReplies: makeSelectRepliesForParentId(props.parentId)(state),
|
|
|
|
totalReplies: makeSelectTotalRepliesForParentId(props.parentId)(state),
|
2020-08-24 13:35:21 -04:00
|
|
|
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
|
|
|
|
commentingEnabled: IS_WEB ? Boolean(selectUserVerifiedEmail(state)) : true,
|
2020-09-11 13:51:31 -04:00
|
|
|
myChannels: selectMyChannelClaims(state),
|
2021-07-15 22:43:28 +08:00
|
|
|
isFetchingByParentId: selectIsFetchingCommentsByParentId(state),
|
2020-08-24 13:35:21 -04:00
|
|
|
});
|
|
|
|
|
2020-09-11 13:51:31 -04:00
|
|
|
export default connect(select)(CommentsReplies);
|