diff --git a/static/app-strings.json b/static/app-strings.json index 6b9964fbd..db3a991ef 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -1562,5 +1562,7 @@ "Delete supports to spend": "Delete supports to spend", "%lbc_amount% boosting content": "%lbc_amount% boosting content", "Deposit cannot be higher than your available balance: %balance%": "Deposit cannot be higher than your available balance: %balance%", + "This channel has disabled comments on their page.": "This channel has disabled comments on their page.", + "The creator of this content has disabled comments.": "The creator of this content has disabled comments.", "--end--": "--end--" } diff --git a/ui/component/channelDiscussion/index.js b/ui/component/channelDiscussion/index.js index 98afd7e21..cb0c52704 100644 --- a/ui/component/channelDiscussion/index.js +++ b/ui/component/channelDiscussion/index.js @@ -1,9 +1,9 @@ import { connect } from 'react-redux'; import { withRouter } from 'react-router'; import { makeSelectCommentForCommentId } from 'redux/selectors/comments'; - +import { DISABLE_COMMENTS_TAG } from 'constants/tags'; import ChannelDiscussion from './view'; -import { makeSelectTagsForUri } from 'lbry-redux'; +import { makeSelectTagInClaimOrChannelForUri } from 'lbry-redux'; const select = (state, props) => { const { search } = props.location; @@ -12,7 +12,7 @@ const select = (state, props) => { return { linkedComment: makeSelectCommentForCommentId(linkedCommentId)(state), - tags: makeSelectTagsForUri(props.uri)(state), + commentsDisabled: makeSelectTagInClaimOrChannelForUri(props.uri, DISABLE_COMMENTS_TAG)(state), }; }; diff --git a/ui/component/channelDiscussion/view.jsx b/ui/component/channelDiscussion/view.jsx index 0a8088b20..50a308a70 100644 --- a/ui/component/channelDiscussion/view.jsx +++ b/ui/component/channelDiscussion/view.jsx @@ -6,14 +6,14 @@ import Empty from 'component/common/empty'; type Props = { uri: string, linkedComment: ?any, - tags: Array, + commentsDisabled: boolean, }; function ChannelDiscussion(props: Props) { - const { uri, linkedComment, tags } = props; + const { uri, linkedComment, commentsDisabled } = props; - if (tags.includes('disable_comments')) { - return ; + if (commentsDisabled) { + return ; } return (
diff --git a/ui/component/tagsSearch/index.js b/ui/component/tagsSearch/index.js index e89d8c3b1..a5eefcc86 100644 --- a/ui/component/tagsSearch/index.js +++ b/ui/component/tagsSearch/index.js @@ -4,7 +4,7 @@ import { doToggleTagFollowDesktop, doAddTag, doDeleteTag } from 'redux/actions/t import { selectUser } from 'redux/selectors/user'; import DiscoveryFirstRun from './view'; -const select = (state, props) => ({ +const select = state => ({ unfollowedTags: selectUnfollowedTags(state), followedTags: selectFollowedTags(state), user: selectUser(state), diff --git a/ui/component/tagsSearch/view.jsx b/ui/component/tagsSearch/view.jsx index 96298ca62..efde1a500 100644 --- a/ui/component/tagsSearch/view.jsx +++ b/ui/component/tagsSearch/view.jsx @@ -147,7 +147,6 @@ export default function TagsSearch(props: Props) { onRemove(selectedTag); } else if (onSelect) { onSelect([{ name: tag }]); - // call an api } } return ( diff --git a/ui/constants/tags.js b/ui/constants/tags.js index 13f4b4086..90ede2d84 100644 --- a/ui/constants/tags.js +++ b/ui/constants/tags.js @@ -13,11 +13,9 @@ export const DEFAULT_FOLLOWED_TAGS = [ 'technology', ]; -export const UTILITY_TAGS = [ - // 'disable_supports', - 'disable_comments', - // 'disable_reactions', -]; +export const DISABLE_COMMENTS_TAG = 'disable-comments'; + +export const UTILITY_TAGS = [DISABLE_COMMENTS_TAG]; export const MATURE_TAGS = [ 'porn', diff --git a/ui/page/channel/index.js b/ui/page/channel/index.js index df3a4d3ac..4d26faa4c 100644 --- a/ui/page/channel/index.js +++ b/ui/page/channel/index.js @@ -7,7 +7,6 @@ import { selectCurrentChannelPage, makeSelectClaimForUri, makeSelectClaimIsPending, - makeSelectTagsForUri, } from 'lbry-redux'; import { selectChannelIsBlocked } from 'redux/selectors/blocked'; import { selectBlackListedOutpoints, doFetchSubCount, makeSelectSubCountForUri } from 'lbryinc'; @@ -29,7 +28,6 @@ const select = (state, props) => ({ subCount: makeSelectSubCountForUri(props.uri)(state), pending: makeSelectClaimIsPending(props.uri)(state), youtubeChannels: selectYoutubeChannels(state), - tags: makeSelectTagsForUri(props.uri)(state), }); const perform = dispatch => ({ diff --git a/ui/page/file/index.js b/ui/page/file/index.js index 1a4e37a70..cc9570d87 100644 --- a/ui/page/file/index.js +++ b/ui/page/file/index.js @@ -13,13 +13,14 @@ import { makeSelectCostInfoForUri, doFetchCostInfoForUri } from 'lbryinc'; import { selectShowMatureContent, makeSelectClientSetting } from 'redux/selectors/settings'; import { makeSelectFileRenderModeForUri } from 'redux/selectors/content'; import { makeSelectCommentForCommentId } from 'redux/selectors/comments'; +import { DISABLE_COMMENTS_TAG } from 'constants/tags'; + import FilePage from './view'; const select = (state, props) => { const { search } = props.location; const urlParams = new URLSearchParams(search); const linkedCommentId = urlParams.get('lc'); - const DISABLE_COMMENTS_TAG = 'disable_comments'; return { linkedComment: makeSelectCommentForCommentId(linkedCommentId)(state), @@ -30,7 +31,7 @@ const select = (state, props) => { fileInfo: makeSelectFileInfoForUri(props.uri)(state), renderMode: makeSelectFileRenderModeForUri(props.uri)(state), videoTheaterMode: makeSelectClientSetting(SETTINGS.VIDEO_THEATER_MODE)(state), - disableComments: makeSelectTagInClaimOrChannelForUri(props.uri, DISABLE_COMMENTS_TAG)(state), + commentsDisabled: makeSelectTagInClaimOrChannelForUri(props.uri, DISABLE_COMMENTS_TAG)(state), }; }; diff --git a/ui/page/file/view.jsx b/ui/page/file/view.jsx index 2ceea0f55..4d05c82bc 100644 --- a/ui/page/file/view.jsx +++ b/ui/page/file/view.jsx @@ -26,7 +26,7 @@ type Props = { linkedComment: any, setPrimaryUri: (?string) => void, videoTheaterMode: boolean, - disableComments: boolean, + commentsDisabled: boolean, }; function FilePage(props: Props) { @@ -43,7 +43,7 @@ function FilePage(props: Props) { linkedComment, setPrimaryUri, videoTheaterMode, - disableComments, + commentsDisabled, } = props; const cost = costInfo ? costInfo.cost : null; const hasFileInfo = fileInfo !== undefined; @@ -123,8 +123,8 @@ function FilePage(props: Props) {
{RENDER_MODES.FLOATING_MODES.includes(renderMode) && } - {disableComments && } - {!disableComments && } + {commentsDisabled && } + {!commentsDisabled && }
{videoTheaterMode && }