This commit is contained in:
Sean Yesmunt 2020-10-13 15:26:59 -04:00
parent 9268fa45e7
commit 172e918de5
3 changed files with 10 additions and 3 deletions

View file

@ -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 = {};

View file

@ -14,10 +14,11 @@ type Props = {
authenticated: boolean,
followedTags: Array<Tag>,
subscribedChannels: Array<Subscription>,
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 (

View file

@ -21,7 +21,8 @@ export default function GetHomePageRowData(
showPersonalizedTags: boolean,
subscribedChannels: Array<Subscription>,
followedTags: Array<Tag>,
showIndividualTags: boolean
showIndividualTags: boolean,
showNsfw: boolean
) {
const isLargeScreen = useIsLargeScreen();