Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customer Home: Add a welcome banner. #39557

Merged
merged 8 commits into from
Feb 21, 2020
Prev Previous commit
Next Next commit
Only display the welcome banner to users newer than 2019-08-06.
  • Loading branch information
kwight committed Feb 21, 2020
commit 5da75501575493b1609418714c294d6771f6e2bb
7 changes: 5 additions & 2 deletions client/my-sites/customer-home/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ class Home extends Component {
siteIsUnlaunched,
isAtomic,
trackAction,
displayWelcomeBanner,
} = this.props;

// Show a thank-you message 30 mins post site creation/purchase
Expand Down Expand Up @@ -304,7 +305,7 @@ class Home extends Component {
</div>
</Card>
) }
<WelcomeBanner />
{ displayWelcomeBanner && <WelcomeBanner /> }
</>
);
}
Expand Down Expand Up @@ -646,10 +647,12 @@ const connectHome = connect(
const isAtomic = isAtomicSite( state, siteId );
const isChecklistComplete = isSiteChecklistComplete( state, siteId );
const createdAt = getSiteOption( state, siteId, 'created_at' );
const user = getCurrentUser( state );

return {
displayChecklist:
isEligibleForDotcomChecklist( state, siteId ) && hasChecklistData && ! isChecklistComplete,
displayWelcomeBanner: user.date ? new Date( user.date ) < new Date( '2019-08-06' ) : false,
site: getSelectedSite( state ),
siteId,
siteSlug: getSelectedSiteSlug( state ),
Expand All @@ -669,7 +672,7 @@ const connectHome = connect(
staticHomePageId: getSiteFrontPage( state, siteId ),
showCustomizer: ! isSiteUsingFullSiteEditing( state, siteId ),
hasCustomDomain: getGSuiteSupportedDomains( domains ).length > 0,
user: getCurrentUser( state ),
user,
...themeInfo,
};
},
Expand Down