diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c33b86ad..cf35eaf20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,6 +68,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Volume setting is now saved between videos ([#2934](https://github.com/lbryio/lbry-desktop/pull/2934)) - Granular balance information on wallet page - includes LBC locked in tips/claims/supports ([#2916](https://github.com/lbryio/lbry-desktop/pull/2916)) - Acknowledgement of [terms of service](https://lbry.com/termsofservice) and age verification on sign in ([#2925](https://github.com/lbryio/lbry-desktop/pull/2925)) +- Hidden NSFW content message on tag search results page ([#3038](https://github.com/lbryio/lbry-desktop/pull/3038)) ### Changed diff --git a/src/ui/component/claimListDiscover/view.jsx b/src/ui/component/claimListDiscover/view.jsx index 5dc75acf9..175bb418f 100644 --- a/src/ui/component/claimListDiscover/view.jsx +++ b/src/ui/component/claimListDiscover/view.jsx @@ -45,6 +45,7 @@ type Props = { [string]: Array, }, hiddenUris: Array, + hiddenNsfwMessage?: Node, }; function ClaimListDiscover(props: Props) { @@ -61,6 +62,7 @@ function ClaimListDiscover(props: Props) { location, hiddenUris, hideCustomization, + hiddenNsfwMessage, } = props; const didNavigateForward = history.action === 'PUSH'; const [page, setPage] = useState(1); @@ -109,6 +111,7 @@ function ClaimListDiscover(props: Props) { (personalSort === SEARCH_SORT_CHANNELS && subscribedChannels.length) || (personalSort === SEARCH_SORT_YOU && !!tags.length) || personalSort === SEARCH_SORT_ALL; + const hasMatureTags = tags.some(t => MATURE_TAGS.includes(t)); const claimSearchCacheQuery = createNormalizedClaimSearchKey(options); const uris = (hasContent && claimSearchByQuery[claimSearchCacheQuery]) || []; const shouldPerformSearch = @@ -237,6 +240,7 @@ function ClaimListDiscover(props: Props) { ))} )} + {hasMatureTags && hiddenNsfwMessage} ); diff --git a/src/ui/component/common/hidden-nsfw.jsx b/src/ui/component/common/hidden-nsfw.jsx new file mode 100644 index 000000000..46dff85bf --- /dev/null +++ b/src/ui/component/common/hidden-nsfw.jsx @@ -0,0 +1,23 @@ +// @flow +import React from 'react'; +import Button from 'component/button'; +import * as ICONS from 'constants/icons'; +import Icon from 'component/common/icon'; +import I18nMessage from 'component/i18nMessage'; + +type Props = { + type?: string, +}; + +export default function HiddenNsfw(props: Props) { + const { type = 'page' } = props; + + return ( +
+ + }}> + Content may be hidden on this %type% because of your %settings% + +
+ ); +} diff --git a/src/ui/page/tags/view.jsx b/src/ui/page/tags/view.jsx index cf2c58407..9c632c3f2 100644 --- a/src/ui/page/tags/view.jsx +++ b/src/ui/page/tags/view.jsx @@ -5,6 +5,7 @@ import ClaimListDiscover from 'component/claimListDiscover'; import Button from 'component/button'; import useHover from 'effects/use-hover'; import analytics from 'analytics'; +import HiddenNsfw from 'component/common/hidden-nsfw'; type Props = { location: { search: string }, @@ -45,6 +46,7 @@ function TagsPage(props: Props) { } meta={