review changes
This commit is contained in:
parent
18682fdac0
commit
40408e25be
9 changed files with 20 additions and 22 deletions
|
@ -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--"
|
||||
}
|
||||
|
|
|
@ -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),
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -6,14 +6,14 @@ import Empty from 'component/common/empty';
|
|||
type Props = {
|
||||
uri: string,
|
||||
linkedComment: ?any,
|
||||
tags: Array<string>,
|
||||
commentsDisabled: boolean,
|
||||
};
|
||||
|
||||
function ChannelDiscussion(props: Props) {
|
||||
const { uri, linkedComment, tags } = props;
|
||||
const { uri, linkedComment, commentsDisabled } = props;
|
||||
|
||||
if (tags.includes('disable_comments')) {
|
||||
return <Empty text={__('Comments are disabled here.')} />;
|
||||
if (commentsDisabled) {
|
||||
return <Empty text={__('This channel has disabled comments on their page.')} />;
|
||||
}
|
||||
return (
|
||||
<section className="section">
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -147,7 +147,6 @@ export default function TagsSearch(props: Props) {
|
|||
onRemove(selectedTag);
|
||||
} else if (onSelect) {
|
||||
onSelect([{ name: tag }]);
|
||||
// call an api
|
||||
}
|
||||
}
|
||||
return (
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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 => ({
|
||||
|
|
|
@ -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),
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -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) {
|
|||
<div className="file-page__secondary-content">
|
||||
<div>
|
||||
{RENDER_MODES.FLOATING_MODES.includes(renderMode) && <FileTitle uri={uri} />}
|
||||
{disableComments && <Empty text={__('Comments are disabled here.')} />}
|
||||
{!disableComments && <CommentsList uri={uri} linkedComment={linkedComment} />}
|
||||
{commentsDisabled && <Empty text={__('The creator of this content has disabled comments.')} />}
|
||||
{!commentsDisabled && <CommentsList uri={uri} linkedComment={linkedComment} />}
|
||||
</div>
|
||||
{videoTheaterMode && <RecommendedContent uri={uri} />}
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue