Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions src/views/splash/presentation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,23 @@ class SplashPresentation extends React.Component { // eslint-disable-line react/
]);
}
renderHomepageRows () {
const rows = [
const rows = [];

if (this.props.shouldShowFeaturedProjectRow) {
rows.push(
<Box
key="community_featured_projects"
title={this.props.intl.formatMessage({
id: 'splash.featuredProjects'
})}
>
<LegacyCarousel items={this.props.featuredGlobal.community_featured_projects} />
</Box>,
</Box>
);
}

if (this.props.shouldShowFeaturedStudioRow) {
rows.push (
<Box
key="community_featured_studios"
title={this.props.intl.formatMessage({
Expand All @@ -229,7 +237,8 @@ class SplashPresentation extends React.Component { // eslint-disable-line react/
}}
/>
</Box>
];
);
}

if (this.props.featuredGlobal.curator_top_projects &&
this.props.featuredGlobal.curator_top_projects.length > 4) {
Expand Down Expand Up @@ -558,6 +567,8 @@ SplashPresentation.propTypes = {
sessionStatus: PropTypes.string.isRequired,
sharedByFollowing: PropTypes.arrayOf(PropTypes.object),
shouldShowCommunityRows: PropTypes.bool,
shouldShowFeaturedProjectRow: PropTypes.bool,
shouldShowFeaturedStudioRow: PropTypes.bool,
shouldShowDonateBanner: PropTypes.bool.isRequired,
shouldShowEmailConfirmation: PropTypes.bool.isRequired,
shouldShowFeaturesBanner: PropTypes.bool.isRequired,
Expand All @@ -576,7 +587,9 @@ SplashPresentation.defaultProps = {
lovedByFollowing: [], // "Projects Loved by Scratchers I'm Following"
news: [], // gets news posts from the scratch Tumblr
sharedByFollowing: [], // "Projects by Scratchers I'm Following"
shouldShowCommunityRows: false
shouldShowCommunityRows: false,
shouldShowFeaturedProjectRow: true,
shouldShowFeaturedStudioRow: false
};

module.exports = injectIntl(SplashPresentation);