review changes

This commit is contained in:
zeppi 2021-02-04 18:00:07 -05:00 committed by jessopb
parent 18682fdac0
commit 40408e25be
9 changed files with 20 additions and 22 deletions

View file

@ -1562,5 +1562,7 @@
"Delete supports to spend": "Delete supports to spend", "Delete supports to spend": "Delete supports to spend",
"%lbc_amount% boosting content": "%lbc_amount% boosting content", "%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%", "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--" "--end--": "--end--"
} }

View file

@ -1,9 +1,9 @@
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { withRouter } from 'react-router'; import { withRouter } from 'react-router';
import { makeSelectCommentForCommentId } from 'redux/selectors/comments'; import { makeSelectCommentForCommentId } from 'redux/selectors/comments';
import { DISABLE_COMMENTS_TAG } from 'constants/tags';
import ChannelDiscussion from './view'; import ChannelDiscussion from './view';
import { makeSelectTagsForUri } from 'lbry-redux'; import { makeSelectTagInClaimOrChannelForUri } from 'lbry-redux';
const select = (state, props) => { const select = (state, props) => {
const { search } = props.location; const { search } = props.location;
@ -12,7 +12,7 @@ const select = (state, props) => {
return { return {
linkedComment: makeSelectCommentForCommentId(linkedCommentId)(state), linkedComment: makeSelectCommentForCommentId(linkedCommentId)(state),
tags: makeSelectTagsForUri(props.uri)(state), commentsDisabled: makeSelectTagInClaimOrChannelForUri(props.uri, DISABLE_COMMENTS_TAG)(state),
}; };
}; };

View file

@ -6,14 +6,14 @@ import Empty from 'component/common/empty';
type Props = { type Props = {
uri: string, uri: string,
linkedComment: ?any, linkedComment: ?any,
tags: Array<string>, commentsDisabled: boolean,
}; };
function ChannelDiscussion(props: Props) { function ChannelDiscussion(props: Props) {
const { uri, linkedComment, tags } = props; const { uri, linkedComment, commentsDisabled } = props;
if (tags.includes('disable_comments')) { if (commentsDisabled) {
return <Empty text={__('Comments are disabled here.')} />; return <Empty text={__('This channel has disabled comments on their page.')} />;
} }
return ( return (
<section className="section"> <section className="section">

View file

@ -4,7 +4,7 @@ import { doToggleTagFollowDesktop, doAddTag, doDeleteTag } from 'redux/actions/t
import { selectUser } from 'redux/selectors/user'; import { selectUser } from 'redux/selectors/user';
import DiscoveryFirstRun from './view'; import DiscoveryFirstRun from './view';
const select = (state, props) => ({ const select = state => ({
unfollowedTags: selectUnfollowedTags(state), unfollowedTags: selectUnfollowedTags(state),
followedTags: selectFollowedTags(state), followedTags: selectFollowedTags(state),
user: selectUser(state), user: selectUser(state),

View file

@ -147,7 +147,6 @@ export default function TagsSearch(props: Props) {
onRemove(selectedTag); onRemove(selectedTag);
} else if (onSelect) { } else if (onSelect) {
onSelect([{ name: tag }]); onSelect([{ name: tag }]);
// call an api
} }
} }
return ( return (

View file

@ -13,11 +13,9 @@ export const DEFAULT_FOLLOWED_TAGS = [
'technology', 'technology',
]; ];
export const UTILITY_TAGS = [ export const DISABLE_COMMENTS_TAG = 'disable-comments';
// 'disable_supports',
'disable_comments', export const UTILITY_TAGS = [DISABLE_COMMENTS_TAG];
// 'disable_reactions',
];
export const MATURE_TAGS = [ export const MATURE_TAGS = [
'porn', 'porn',

View file

@ -7,7 +7,6 @@ import {
selectCurrentChannelPage, selectCurrentChannelPage,
makeSelectClaimForUri, makeSelectClaimForUri,
makeSelectClaimIsPending, makeSelectClaimIsPending,
makeSelectTagsForUri,
} from 'lbry-redux'; } from 'lbry-redux';
import { selectChannelIsBlocked } from 'redux/selectors/blocked'; import { selectChannelIsBlocked } from 'redux/selectors/blocked';
import { selectBlackListedOutpoints, doFetchSubCount, makeSelectSubCountForUri } from 'lbryinc'; import { selectBlackListedOutpoints, doFetchSubCount, makeSelectSubCountForUri } from 'lbryinc';
@ -29,7 +28,6 @@ const select = (state, props) => ({
subCount: makeSelectSubCountForUri(props.uri)(state), subCount: makeSelectSubCountForUri(props.uri)(state),
pending: makeSelectClaimIsPending(props.uri)(state), pending: makeSelectClaimIsPending(props.uri)(state),
youtubeChannels: selectYoutubeChannels(state), youtubeChannels: selectYoutubeChannels(state),
tags: makeSelectTagsForUri(props.uri)(state),
}); });
const perform = dispatch => ({ const perform = dispatch => ({

View file

@ -13,13 +13,14 @@ import { makeSelectCostInfoForUri, doFetchCostInfoForUri } from 'lbryinc';
import { selectShowMatureContent, makeSelectClientSetting } from 'redux/selectors/settings'; import { selectShowMatureContent, makeSelectClientSetting } from 'redux/selectors/settings';
import { makeSelectFileRenderModeForUri } from 'redux/selectors/content'; import { makeSelectFileRenderModeForUri } from 'redux/selectors/content';
import { makeSelectCommentForCommentId } from 'redux/selectors/comments'; import { makeSelectCommentForCommentId } from 'redux/selectors/comments';
import { DISABLE_COMMENTS_TAG } from 'constants/tags';
import FilePage from './view'; import FilePage from './view';
const select = (state, props) => { const select = (state, props) => {
const { search } = props.location; const { search } = props.location;
const urlParams = new URLSearchParams(search); const urlParams = new URLSearchParams(search);
const linkedCommentId = urlParams.get('lc'); const linkedCommentId = urlParams.get('lc');
const DISABLE_COMMENTS_TAG = 'disable_comments';
return { return {
linkedComment: makeSelectCommentForCommentId(linkedCommentId)(state), linkedComment: makeSelectCommentForCommentId(linkedCommentId)(state),
@ -30,7 +31,7 @@ const select = (state, props) => {
fileInfo: makeSelectFileInfoForUri(props.uri)(state), fileInfo: makeSelectFileInfoForUri(props.uri)(state),
renderMode: makeSelectFileRenderModeForUri(props.uri)(state), renderMode: makeSelectFileRenderModeForUri(props.uri)(state),
videoTheaterMode: makeSelectClientSetting(SETTINGS.VIDEO_THEATER_MODE)(state), videoTheaterMode: makeSelectClientSetting(SETTINGS.VIDEO_THEATER_MODE)(state),
disableComments: makeSelectTagInClaimOrChannelForUri(props.uri, DISABLE_COMMENTS_TAG)(state), commentsDisabled: makeSelectTagInClaimOrChannelForUri(props.uri, DISABLE_COMMENTS_TAG)(state),
}; };
}; };

View file

@ -26,7 +26,7 @@ type Props = {
linkedComment: any, linkedComment: any,
setPrimaryUri: (?string) => void, setPrimaryUri: (?string) => void,
videoTheaterMode: boolean, videoTheaterMode: boolean,
disableComments: boolean, commentsDisabled: boolean,
}; };
function FilePage(props: Props) { function FilePage(props: Props) {
@ -43,7 +43,7 @@ function FilePage(props: Props) {
linkedComment, linkedComment,
setPrimaryUri, setPrimaryUri,
videoTheaterMode, videoTheaterMode,
disableComments, commentsDisabled,
} = props; } = props;
const cost = costInfo ? costInfo.cost : null; const cost = costInfo ? costInfo.cost : null;
const hasFileInfo = fileInfo !== undefined; const hasFileInfo = fileInfo !== undefined;
@ -123,8 +123,8 @@ function FilePage(props: Props) {
<div className="file-page__secondary-content"> <div className="file-page__secondary-content">
<div> <div>
{RENDER_MODES.FLOATING_MODES.includes(renderMode) && <FileTitle uri={uri} />} {RENDER_MODES.FLOATING_MODES.includes(renderMode) && <FileTitle uri={uri} />}
{disableComments && <Empty text={__('Comments are disabled here.')} />} {commentsDisabled && <Empty text={__('The creator of this content has disabled comments.')} />}
{!disableComments && <CommentsList uri={uri} linkedComment={linkedComment} />} {!commentsDisabled && <CommentsList uri={uri} linkedComment={linkedComment} />}
</div> </div>
{videoTheaterMode && <RecommendedContent uri={uri} />} {videoTheaterMode && <RecommendedContent uri={uri} />}
</div> </div>