2021-03-10 13:34:21 -05:00
|
|
|
import { connect } from 'react-redux';
|
2021-05-04 23:08:36 +08:00
|
|
|
import { makeSelectClaimForUri, selectMyChannelClaims } from 'lbry-redux';
|
2021-03-16 16:59:31 -04:00
|
|
|
import { doCommentSocketConnect, doCommentSocketDisconnect } from 'redux/actions/websocket';
|
2021-04-23 15:59:48 -04:00
|
|
|
import { doCommentList, doSuperChatList } from 'redux/actions/comments';
|
|
|
|
import {
|
|
|
|
makeSelectTopLevelCommentsForUri,
|
|
|
|
selectIsFetchingComments,
|
|
|
|
makeSelectSuperChatsForUri,
|
|
|
|
makeSelectSuperChatTotalAmountForUri,
|
2021-08-17 09:09:55 -07:00
|
|
|
makeSelectPinnedCommentsForUri,
|
2021-04-23 15:59:48 -04:00
|
|
|
} from 'redux/selectors/comments';
|
2021-07-06 09:29:46 +08:00
|
|
|
import LivestreamComments from './view';
|
2021-03-10 13:34:21 -05:00
|
|
|
|
|
|
|
const select = (state, props) => ({
|
|
|
|
claim: makeSelectClaimForUri(props.uri)(state),
|
2021-04-05 21:45:42 -04:00
|
|
|
comments: makeSelectTopLevelCommentsForUri(props.uri)(state).slice(0, 75),
|
2021-08-17 09:09:55 -07:00
|
|
|
pinnedComments: makeSelectPinnedCommentsForUri(props.uri)(state),
|
2021-03-10 13:34:21 -05:00
|
|
|
fetchingComments: selectIsFetchingComments(state),
|
2021-04-23 15:59:48 -04:00
|
|
|
superChats: makeSelectSuperChatsForUri(props.uri)(state),
|
|
|
|
superChatsTotalAmount: makeSelectSuperChatTotalAmountForUri(props.uri)(state),
|
2021-05-04 23:08:36 +08:00
|
|
|
myChannels: selectMyChannelClaims(state),
|
2021-03-10 13:34:21 -05:00
|
|
|
});
|
|
|
|
|
2021-04-23 15:59:48 -04:00
|
|
|
export default connect(select, {
|
|
|
|
doCommentSocketConnect,
|
|
|
|
doCommentSocketDisconnect,
|
|
|
|
doCommentList,
|
|
|
|
doSuperChatList,
|
2021-07-06 09:29:46 +08:00
|
|
|
})(LivestreamComments);
|