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';
|
|
|
|
import { makeSelectCommentForCommentId } from 'redux/selectors/comments';
|
|
|
|
|
2019-10-15 00:21:40 +02:00
|
|
|
import ChannelDiscussion from './view';
|
2021-02-04 06:45:49 +01:00
|
|
|
import { makeSelectTagsForUri } from 'lbry-redux';
|
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);
|
|
|
|
const linkedCommentId = urlParams.get('lc');
|
|
|
|
|
|
|
|
return {
|
|
|
|
linkedComment: makeSelectCommentForCommentId(linkedCommentId)(state),
|
2021-02-04 06:45:49 +01:00
|
|
|
tags: makeSelectTagsForUri(props.uri)(state),
|
2020-08-31 19:12:34 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export default withRouter(connect(select)(ChannelDiscussion));
|