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