Actually hide NSFW content #1748
2 changed files with 9 additions and 3 deletions
|
@ -5,6 +5,7 @@ import {
|
|||
makeSelectClaimsInChannelForCurrentPage,
|
||||
makeSelectFetchingChannelClaims,
|
||||
makeSelectCurrentParam,
|
||||
makeSelectClaimIsMine,
|
||||
selectCurrentParams,
|
||||
} from 'lbry-redux';
|
||||
import { doNavigate } from 'redux/actions/navigation';
|
||||
|
@ -18,6 +19,7 @@ const select = (state, props) => ({
|
|||
page: makeSelectCurrentParam('page')(state),
|
||||
params: selectCurrentParams(state),
|
||||
totalPages: makeSelectTotalPagesForChannel(props.uri)(state),
|
||||
channelIsMine: makeSelectClaimIsMine(props.uri)(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
|
@ -26,4 +28,7 @@ const perform = dispatch => ({
|
|||
navigate: (path, params) => dispatch(doNavigate(path, params)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(ChannelPage);
|
||||
export default connect(
|
||||
select,
|
||||
perform
|
||||
)(ChannelPage);
|
||||
|
|
|
@ -18,6 +18,7 @@ type Props = {
|
|||
params: { page: number },
|
||||
claim: Claim,
|
||||
claimsInChannel: Array<Claim>,
|
||||
channelIsMine: boolean,
|
||||
fetchClaims: (string, number) => void,
|
||||
fetchClaimCount: string => void,
|
||||
navigate: (string, {}) => void,
|
||||
|
@ -66,7 +67,7 @@ class ChannelPage extends React.PureComponent<Props> {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { uri, fetching, claimsInChannel, claim, page, totalPages } = this.props;
|
||||
const { uri, fetching, claimsInChannel, claim, page, totalPages, channelIsMine } = this.props;
|
||||
const { name, permanent_url: permanentUrl, claim_id: claimId } = claim;
|
||||
const currentPage = parseInt((page || 1) - 1, 10);
|
||||
|
||||
|
@ -118,7 +119,7 @@ class ChannelPage extends React.PureComponent<Props> {
|
|||
/>
|
||||
</FormRow>
|
||||
)}
|
||||
<HiddenNsfwClaims className="card__content help" uri={uri} />
|
||||
{!channelIsMine && <HiddenNsfwClaims className="card__content help" uri={uri} />}
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue