2019-10-15 00:21:40 +02:00
|
|
|
import { connect } from 'react-redux';
|
2020-08-31 19:12:34 +02:00
|
|
|
import { withRouter } from 'react-router';
|
2021-02-05 00:00:07 +01:00
|
|
|
import { DISABLE_COMMENTS_TAG } from 'constants/tags';
|
2019-10-15 00:21:40 +02:00
|
|
|
import ChannelDiscussion from './view';
|
2021-10-17 10:36:14 +02:00
|
|
|
import { makeSelectTagInClaimOrChannelForUri } from 'redux/selectors/claims';
|
2019-10-15 00:21:40 +02:00
|
|
|
|
2020-08-31 19:12:34 +02:00
|
|
|
const select = (state, props) => {
|
|
|
|
const { search } = props.location;
|
|
|
|
const urlParams = new URLSearchParams(search);
|
|
|
|
|
|
|
|
return {
|
2021-07-15 16:43:28 +02:00
|
|
|
linkedCommentId: urlParams.get('lc'),
|
2021-02-05 00:00:07 +01:00
|
|
|
commentsDisabled: makeSelectTagInClaimOrChannelForUri(props.uri, DISABLE_COMMENTS_TAG)(state),
|
2020-08-31 19:12:34 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export default withRouter(connect(select)(ChannelDiscussion));
|