Actually hide NSFW content #1748

Merged
neb-b merged 8 commits from hide-nsfw into master 2018-07-13 20:31:15 +02:00
2 changed files with 9 additions and 4 deletions
Showing only changes of commit cbefacf673 - Show all commits

View file

@ -7,6 +7,7 @@ import Button from 'component/button';
import FileList from 'component/fileList'; import FileList from 'component/fileList';
import type { Claim } from 'types/claim'; import type { Claim } from 'types/claim';
import isDev from 'electron-is-dev'; import isDev from 'electron-is-dev';
import HiddenNsfwClaims from 'component/hiddenNsfwClaims';
type Props = { type Props = {
doFetchClaimsByChannel: (string, number) => void, doFetchClaimsByChannel: (string, number) => void,
@ -51,9 +52,10 @@ export default class extends React.PureComponent<Props> {
if (claim.claims.length) { if (claim.claims.length) {
subscriptionClaimMap[claim.uri] = 1; subscriptionClaimMap[claim.uri] = 1;
} else if (isDev) { } else if (isDev) {
console.error( console
`claim for ${claim.uri} was added to byId in redux but there are no loaded fetched claims` .error
); // `claim for ${claim.uri} was added to byId in redux but there are no loaded fetched claims`
();
} }
}); });
@ -72,6 +74,8 @@ export default class extends React.PureComponent<Props> {
claimList = claimList.concat(claimData.claims); claimList = claimList.concat(claimData.claims);
}); });
const subscriptionUris = claimList.map(claim => `lbry://${claim.name}#${claim.claim_id}`);
return ( return (
<Page notContained loading={isFetchingSubscriptions}> <Page notContained loading={isFetchingSubscriptions}>
{!subscriptions.length && ( {!subscriptions.length && (
@ -83,6 +87,7 @@ export default class extends React.PureComponent<Props> {
</div> </div>
)} )}
{!!claimList.length && <FileList hideFilter sortByHeight fileInfos={claimList} />} {!!claimList.length && <FileList hideFilter sortByHeight fileInfos={claimList} />}
<HiddenNsfwClaims uris={subscriptionUris} />
</Page> </Page>
); );
} }

View file

@ -357,7 +357,7 @@
.card { .card {
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
margin-bottom: 60px; margin-bottom: $spacing-vertical * 3/2;
@media only screen and (max-width: $medium-breakpoint) { @media only screen and (max-width: $medium-breakpoint) {
width: calc((100% / 4) - (60px / 4)); // 60px === 20px margin-right * three cards width: calc((100% / 4) - (60px / 4)); // 60px === 20px margin-right * three cards