4c57cdd99f
## Issue: Fixes 4549 `Mature content + navigating to URLs directly` _If a user navigates to mature content directly, we currently show the page even if mature content setting is not enabled. With our recent mature content verification setting, we should hide the page until the user turns it on - we can prompt directly on the file page._ ## Changes: 1. Show basic info of the claim like URL and Title, so that user knows which page is being blocked. 2. Initially, I had 2 "boxes" -- one for the title and another for the message. It felt a bit messy, so `FileTitle` was augmented to house everything in one box.
37 lines
1.6 KiB
JavaScript
37 lines
1.6 KiB
JavaScript
import { connect } from 'react-redux';
|
|
import { doRemoveUnreadSubscription } from 'redux/actions/subscriptions';
|
|
import { doSetContentHistoryItem } from 'redux/actions/content';
|
|
import {
|
|
doFetchFileInfo,
|
|
makeSelectFileInfoForUri,
|
|
makeSelectClaimForUri,
|
|
makeSelectMetadataForUri,
|
|
makeSelectChannelForClaimUri,
|
|
makeSelectClaimIsNsfw,
|
|
} from 'lbry-redux';
|
|
import { makeSelectCostInfoForUri, doFetchCostInfoForUri } from 'lbryinc';
|
|
import { selectShowMatureContent } from 'redux/selectors/settings';
|
|
import { makeSelectIsSubscribed } from 'redux/selectors/subscriptions';
|
|
import { makeSelectFileRenderModeForUri } from 'redux/selectors/content';
|
|
import FilePage from './view';
|
|
|
|
const select = (state, props) => ({
|
|
claim: makeSelectClaimForUri(props.uri)(state),
|
|
costInfo: makeSelectCostInfoForUri(props.uri)(state),
|
|
metadata: makeSelectMetadataForUri(props.uri)(state),
|
|
obscureNsfw: !selectShowMatureContent(state),
|
|
isMature: makeSelectClaimIsNsfw(props.uri)(state),
|
|
fileInfo: makeSelectFileInfoForUri(props.uri)(state),
|
|
isSubscribed: makeSelectIsSubscribed(props.uri)(state),
|
|
channelUri: makeSelectChannelForClaimUri(props.uri, true)(state),
|
|
renderMode: makeSelectFileRenderModeForUri(props.uri)(state),
|
|
});
|
|
|
|
const perform = dispatch => ({
|
|
fetchFileInfo: uri => dispatch(doFetchFileInfo(uri)),
|
|
fetchCostInfo: uri => dispatch(doFetchCostInfoForUri(uri)),
|
|
setViewed: uri => dispatch(doSetContentHistoryItem(uri)),
|
|
markSubscriptionRead: (channel, uri) => dispatch(doRemoveUnreadSubscription(channel, uri)),
|
|
});
|
|
|
|
export default connect(select, perform)(FilePage);
|