2021-09-30 23:30:32 +02:00
|
|
|
import { connect } from 'react-redux';
|
2021-11-17 08:45:58 +01:00
|
|
|
import { MAX_LIVESTREAM_COMMENTS } from 'constants/livestream';
|
2021-09-30 23:30:32 +02:00
|
|
|
import { selectShowMatureContent } from 'redux/selectors/settings';
|
2021-11-17 09:18:00 +01:00
|
|
|
import { selectSubscriptionUris } from 'redux/selectors/subscriptions';
|
2021-09-30 23:30:32 +02:00
|
|
|
import { withRouter } from 'react-router';
|
2021-11-17 17:47:56 +01:00
|
|
|
import { selectCanonicalUrlForUri } from 'redux/selectors/claims';
|
2021-10-17 10:36:14 +02:00
|
|
|
import { doResolveUris } from 'redux/actions/claims';
|
2021-11-17 17:47:56 +01:00
|
|
|
import { selectChannelMentionData } from 'redux/selectors/livestream';
|
2021-09-30 23:30:32 +02:00
|
|
|
import ChannelMentionSuggestions from './view';
|
|
|
|
|
|
|
|
const select = (state, props) => {
|
2021-11-17 17:47:56 +01:00
|
|
|
const maxComments = props.isLivestream ? MAX_LIVESTREAM_COMMENTS : -1;
|
|
|
|
const data = selectChannelMentionData(state, props.uri, maxComments);
|
2021-09-30 23:30:32 +02:00
|
|
|
|
|
|
|
return {
|
2021-11-17 17:47:56 +01:00
|
|
|
commentorUris: data.commentorUris,
|
|
|
|
subscriptionUris: selectSubscriptionUris(state),
|
|
|
|
unresolvedCommentors: data.unresolvedCommentors,
|
|
|
|
unresolvedSubscriptions: data.unresolvedSubscriptions,
|
|
|
|
canonicalCreator: selectCanonicalUrlForUri(state, props.creatorUri),
|
|
|
|
canonicalCommentors: data.canonicalCommentors,
|
|
|
|
canonicalSubscriptions: data.canonicalSubscriptions,
|
2021-09-30 23:30:32 +02:00
|
|
|
showMature: selectShowMatureContent(state),
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export default withRouter(connect(select, { doResolveUris })(ChannelMentionSuggestions));
|