From 172e918de50c53eb6bb9ffe03d3074358747116c Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 13 Oct 2020 15:26:59 -0400 Subject: [PATCH] pass to --- ui/page/home/index.js | 4 ++++ ui/page/home/view.jsx | 6 ++++-- ui/util/homepage.js | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ui/page/home/index.js b/ui/page/home/index.js index 154505f65..a70c7afd2 100644 --- a/ui/page/home/index.js +++ b/ui/page/home/index.js @@ -1,13 +1,17 @@ +import * as SETTINGS from 'constants/settings'; import { connect } from 'react-redux'; import { selectFollowedTags } from 'lbry-redux'; import { selectUserVerifiedEmail } from 'redux/selectors/user'; import { selectSubscriptions } from 'redux/selectors/subscriptions'; +import { makeSelectClientSetting } from 'redux/selectors/settings'; + import DiscoverPage from './view'; const select = state => ({ followedTags: selectFollowedTags(state), subscribedChannels: selectSubscriptions(state), authenticated: selectUserVerifiedEmail(state), + showNsfw: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state), }); const perform = {}; diff --git a/ui/page/home/view.jsx b/ui/page/home/view.jsx index e901efa83..4432a5172 100644 --- a/ui/page/home/view.jsx +++ b/ui/page/home/view.jsx @@ -14,10 +14,11 @@ type Props = { authenticated: boolean, followedTags: Array, subscribedChannels: Array, + showNsfw: boolean, }; function HomePage(props: Props) { - const { followedTags, subscribedChannels, authenticated } = props; + const { followedTags, subscribedChannels, authenticated, showNsfw } = props; const showPersonalizedChannels = (authenticated || !IS_WEB) && subscribedChannels && subscribedChannels.length > 0; const showPersonalizedTags = (authenticated || !IS_WEB) && followedTags && followedTags.length > 0; const showIndividualTags = showPersonalizedTags && followedTags.length < 5; @@ -28,7 +29,8 @@ function HomePage(props: Props) { showPersonalizedTags, subscribedChannels, followedTags, - showIndividualTags + showIndividualTags, + showNsfw ); return ( diff --git a/ui/util/homepage.js b/ui/util/homepage.js index b9a2a7c7a..a6eadd550 100644 --- a/ui/util/homepage.js +++ b/ui/util/homepage.js @@ -21,7 +21,8 @@ export default function GetHomePageRowData( showPersonalizedTags: boolean, subscribedChannels: Array, followedTags: Array, - showIndividualTags: boolean + showIndividualTags: boolean, + showNsfw: boolean ) { const isLargeScreen = useIsLargeScreen();