Mature fixes
This commit is contained in:
parent
28b9e2a4d3
commit
9a247d3c9f
5 changed files with 23 additions and 5 deletions
|
@ -4,6 +4,7 @@ import {
|
||||||
selectClaimForUri,
|
selectClaimForUri,
|
||||||
selectHasChannels,
|
selectHasChannels,
|
||||||
makeSelectTagInClaimOrChannelForUri,
|
makeSelectTagInClaimOrChannelForUri,
|
||||||
|
selectClaimIsNsfwForUri,
|
||||||
} from 'redux/selectors/claims';
|
} from 'redux/selectors/claims';
|
||||||
import { makeSelectStreamingUrlForUri } from 'redux/selectors/file_info';
|
import { makeSelectStreamingUrlForUri } from 'redux/selectors/file_info';
|
||||||
import { doPrepareEdit } from 'redux/actions/publish';
|
import { doPrepareEdit } from 'redux/actions/publish';
|
||||||
|
@ -29,7 +30,8 @@ const select = (state, props) => {
|
||||||
hasChannels: selectHasChannels(state),
|
hasChannels: selectHasChannels(state),
|
||||||
isLivestreamClaim: isStreamPlaceholderClaim(claim),
|
isLivestreamClaim: isStreamPlaceholderClaim(claim),
|
||||||
streamingUrl: makeSelectStreamingUrlForUri(uri)(state),
|
streamingUrl: makeSelectStreamingUrlForUri(uri)(state),
|
||||||
disableDownloadButton: makeSelectTagInClaimOrChannelForUri(props.uri, DISABLE_DOWNLOAD_BUTTON_TAG)(state),
|
disableDownloadButton: makeSelectTagInClaimOrChannelForUri(uri, DISABLE_DOWNLOAD_BUTTON_TAG)(state),
|
||||||
|
isMature: selectClaimIsNsfwForUri(state, uri),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@ type Props = {
|
||||||
doPrepareEdit: (claim: Claim, uri: string) => void,
|
doPrepareEdit: (claim: Claim, uri: string) => void,
|
||||||
doToast: (data: { message: string }) => void,
|
doToast: (data: { message: string }) => void,
|
||||||
doDownloadUri: (uri: string) => void,
|
doDownloadUri: (uri: string) => void,
|
||||||
|
isMature: boolean,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function FileActions(props: Props) {
|
export default function FileActions(props: Props) {
|
||||||
|
@ -52,6 +53,7 @@ export default function FileActions(props: Props) {
|
||||||
doPrepareEdit,
|
doPrepareEdit,
|
||||||
doToast,
|
doToast,
|
||||||
doDownloadUri,
|
doDownloadUri,
|
||||||
|
isMature,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
@ -221,7 +223,7 @@ export default function FileActions(props: Props) {
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{!isLivestreamClaim && !disableDownloadButton && (
|
{!isLivestreamClaim && !disableDownloadButton && !isMature && (
|
||||||
<MenuItem className="comment__menu-option" onSelect={handleWebDownload}>
|
<MenuItem className="comment__menu-option" onSelect={handleWebDownload}>
|
||||||
<div className="menu__link">
|
<div className="menu__link">
|
||||||
<Icon aria-hidden icon={ICONS.DOWNLOAD} />
|
<Icon aria-hidden icon={ICONS.DOWNLOAD} />
|
||||||
|
|
|
@ -1,9 +1,15 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doFetchInviteStatus } from 'redux/actions/user';
|
import { doFetchInviteStatus } from 'redux/actions/user';
|
||||||
import { selectClaimForUri, selectTitleForUri } from 'redux/selectors/claims';
|
import {
|
||||||
|
selectClaimForUri,
|
||||||
|
selectTitleForUri,
|
||||||
|
makeSelectTagInClaimOrChannelForUri,
|
||||||
|
selectClaimIsNsfwForUri,
|
||||||
|
} from 'redux/selectors/claims';
|
||||||
import SocialShare from './view';
|
import SocialShare from './view';
|
||||||
import { selectUserInviteReferralCode, selectUser, selectUserInviteStatusFetched } from 'redux/selectors/user';
|
import { selectUserInviteReferralCode, selectUser, selectUserInviteStatusFetched } from 'redux/selectors/user';
|
||||||
import { selectContentPositionForUri } from 'redux/selectors/content';
|
import { selectContentPositionForUri } from 'redux/selectors/content';
|
||||||
|
import { DISABLE_DOWNLOAD_BUTTON_TAG } from 'constants/tags';
|
||||||
|
|
||||||
const select = (state, props) => {
|
const select = (state, props) => {
|
||||||
const { uri } = props;
|
const { uri } = props;
|
||||||
|
@ -15,6 +21,8 @@ const select = (state, props) => {
|
||||||
user: selectUser(state),
|
user: selectUser(state),
|
||||||
title: selectTitleForUri(state, uri),
|
title: selectTitleForUri(state, uri),
|
||||||
position: selectContentPositionForUri(state, uri),
|
position: selectContentPositionForUri(state, uri),
|
||||||
|
disableDownloadButton: makeSelectTagInClaimOrChannelForUri(uri, DISABLE_DOWNLOAD_BUTTON_TAG)(state),
|
||||||
|
isMature: selectClaimIsNsfwForUri(state, uri),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,8 @@ type Props = {
|
||||||
position: number,
|
position: number,
|
||||||
collectionId?: number,
|
collectionId?: number,
|
||||||
doFetchInviteStatus: (boolean) => void,
|
doFetchInviteStatus: (boolean) => void,
|
||||||
|
disableDownloadButton: boolean,
|
||||||
|
isMature: boolean,
|
||||||
};
|
};
|
||||||
|
|
||||||
function SocialShare(props: Props) {
|
function SocialShare(props: Props) {
|
||||||
|
@ -49,6 +51,8 @@ function SocialShare(props: Props) {
|
||||||
position,
|
position,
|
||||||
collectionId,
|
collectionId,
|
||||||
doFetchInviteStatus,
|
doFetchInviteStatus,
|
||||||
|
disableDownloadButton,
|
||||||
|
isMature,
|
||||||
} = props;
|
} = props;
|
||||||
const [showEmbed, setShowEmbed] = React.useState(false);
|
const [showEmbed, setShowEmbed] = React.useState(false);
|
||||||
const [includeCollectionId, setIncludeCollectionId] = React.useState(Boolean(collectionId)); // unless it *is* a collection?
|
const [includeCollectionId, setIncludeCollectionId] = React.useState(Boolean(collectionId)); // unless it *is* a collection?
|
||||||
|
@ -245,7 +249,9 @@ function SocialShare(props: Props) {
|
||||||
))}
|
))}
|
||||||
{showClaimLinks && (
|
{showClaimLinks && (
|
||||||
<div className="section">
|
<div className="section">
|
||||||
{Boolean(isStream) && <CopyableText label={__('Download Link')} copyable={downloadUrl} />}
|
{Boolean(isStream) && !disableDownloadButton && !isMature && (
|
||||||
|
<CopyableText label={__('Download Link')} copyable={downloadUrl} />
|
||||||
|
)}
|
||||||
{Boolean(rssUrl) && <CopyableText label={__('RSS Url')} copyable={rssUrl} />}
|
{Boolean(rssUrl) && <CopyableText label={__('RSS Url')} copyable={rssUrl} />}
|
||||||
{Boolean(isChannel) && (
|
{Boolean(isChannel) && (
|
||||||
<>
|
<>
|
||||||
|
|
|
@ -156,7 +156,7 @@ export default function FilePage(props: Props) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RENDER_MODES.UNRENDERABLE_MODES.includes(renderMode)) {
|
if (RENDER_MODES.UNRENDERABLE_MODES.includes(renderMode) && !isMature) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<FileTitleSection uri={uri} />
|
<FileTitleSection uri={uri} />
|
||||||
|
|
Loading…
Reference in a new issue