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

18 lines
590 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
import { withRouter } from 'react-router';
2021-02-05 00:00:07 +01:00
import { DISABLE_COMMENTS_TAG } from 'constants/tags';
import ChannelDiscussion from './view';
2021-02-05 00:00:07 +01:00
import { makeSelectTagInClaimOrChannelForUri } from 'lbry-redux';
const select = (state, props) => {
const { search } = props.location;
const urlParams = new URLSearchParams(search);
return {
linkedCommentId: urlParams.get('lc'),
2021-02-05 00:00:07 +01:00
commentsDisabled: makeSelectTagInClaimOrChannelForUri(props.uri, DISABLE_COMMENTS_TAG)(state),
};
};
export default withRouter(connect(select)(ChannelDiscussion));