Skip to content

Commit 4c3be40

Browse files
committed
fix: add prop to show/hide community homepage rows
1 parent 4bd4803 commit 4c3be40

File tree

1 file changed

+25
-21
lines changed

1 file changed

+25
-21
lines changed

src/views/splash/presentation.jsx

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -303,26 +303,28 @@ class SplashPresentation extends React.Component { // eslint-disable-line react/
303303
);
304304
}
305305

306-
rows.push(
307-
<Box
308-
key="community_most_remixed_projects"
309-
title={this.props.intl.formatMessage({id: 'splash.communityRemixing'})}
310-
>
311-
<LegacyCarousel
312-
showRemixes
313-
items={shuffle(this.props.featuredGlobal.community_most_remixed_projects)}
314-
/>
315-
</Box>,
316-
<Box
317-
key="community_most_loved_projects"
318-
title={this.props.intl.formatMessage({id: 'splash.communityLoving'})}
319-
>
320-
<LegacyCarousel
321-
showLoves
322-
items={shuffle(this.props.featuredGlobal.community_most_loved_projects)}
323-
/>
324-
</Box>
325-
);
306+
if (this.props.shouldShowCommunityRows) {
307+
rows.push(
308+
<Box
309+
key="community_most_remixed_projects"
310+
title={this.props.intl.formatMessage({id: 'splash.communityRemixing'})}
311+
>
312+
<LegacyCarousel
313+
showRemixes
314+
items={shuffle(this.props.featuredGlobal.community_most_remixed_projects)}
315+
/>
316+
</Box>,
317+
<Box
318+
key="community_most_loved_projects"
319+
title={this.props.intl.formatMessage({id: 'splash.communityLoving'})}
320+
>
321+
<LegacyCarousel
322+
showLoves
323+
items={shuffle(this.props.featuredGlobal.community_most_loved_projects)}
324+
/>
325+
</Box>
326+
);
327+
}
326328

327329
return rows;
328330
}
@@ -555,6 +557,7 @@ SplashPresentation.propTypes = {
555557
refreshCacheStatus: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
556558
sessionStatus: PropTypes.string.isRequired,
557559
sharedByFollowing: PropTypes.arrayOf(PropTypes.object),
560+
shouldShowCommunityRows: PropTypes.bool,
558561
shouldShowDonateBanner: PropTypes.bool.isRequired,
559562
shouldShowEmailConfirmation: PropTypes.bool.isRequired,
560563
shouldShowFeaturesBanner: PropTypes.bool.isRequired,
@@ -572,7 +575,8 @@ SplashPresentation.defaultProps = {
572575
inStudiosFollowing: [], // "Projects in Studios I'm Following"
573576
lovedByFollowing: [], // "Projects Loved by Scratchers I'm Following"
574577
news: [], // gets news posts from the scratch Tumblr
575-
sharedByFollowing: [] // "Projects by Scratchers I'm Following"
578+
sharedByFollowing: [], // "Projects by Scratchers I'm Following"
579+
shouldShowCommunityRows: false
576580
};
577581

578582
module.exports = injectIntl(SplashPresentation);

0 commit comments

Comments
 (0)