Skip to content

Commit

Permalink
load newsletter v2 launchpad in /home
Browse files Browse the repository at this point in the history
  • Loading branch information
candy02058912 committed Jan 22, 2025
1 parent 5bc3383 commit 49f0d0d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions client/my-sites/customer-home/cards/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export const LAUNCHPAD_INTENT_HOSTING = 'home-launchpad-intent-hosting';
export const LAUNCHPAD_INTENT_WRITE = 'home-launchpad-intent-write';
export const LAUNCHPAD_INTENT_FREE_NEWSLETTER = 'home-launchpad-intent-free-newsletter';
export const LAUNCHPAD_INTENT_PAID_NEWSLETTER = 'home-launchpad-intent-paid-newsletter';
export const LAUNCHPAD_INTENT_NEWSLETTER_V2 = 'home-launchpad-intent-newsletter-v2';
export const LAUNCHPAD_PRE_LAUNCH = 'home-launchpad-pre-launch';
export const LAUNCHPAD_LEGACY_SITE_SETUP = 'home-launchpad-legacy-site-setup';
export const LAUNCHPAD_POST_MIGRATION = 'home-launchpad-post-migration';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ export const LaunchpadIntentFreeNewsletter = (): JSX.Element => {
export const LaunchpadIntentPaidNewsletter = (): JSX.Element => {
return <LaunchpadIntentNewsletter checklistSlug="intent-paid-newsletter" />;
};

export const LaunchpadIntentNewsletterV2 = (): JSX.Element => {
return <LaunchpadIntentNewsletter checklistSlug="intent-newsletter-v2" />;
};
3 changes: 3 additions & 0 deletions client/my-sites/customer-home/locations/card-components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import {
TASK_VERIFY_EMAIL,
TASK_WEBINARS,
TASK_WP_COURSES,
LAUNCHPAD_INTENT_NEWSLETTER_V2,
} from 'calypso/my-sites/customer-home/cards/constants';
import DomainUpsellFeature from 'calypso/my-sites/customer-home/cards/features/domain-upsell';
import HelpSearch from 'calypso/my-sites/customer-home/cards/features/help-search';
Expand All @@ -58,6 +59,7 @@ import LaunchpadIntentBuild from 'calypso/my-sites/customer-home/cards/launchpad
import LaunchpadIntentHosting from 'calypso/my-sites/customer-home/cards/launchpad/intent-hosting';
import {
LaunchpadIntentFreeNewsletter,
LaunchpadIntentNewsletterV2,
LaunchpadIntentPaidNewsletter,
} from 'calypso/my-sites/customer-home/cards/launchpad/intent-newsletter';
import LaunchpadIntentWrite from 'calypso/my-sites/customer-home/cards/launchpad/intent-write';
Expand Down Expand Up @@ -150,6 +152,7 @@ const CARD_COMPONENTS: CardComponentMap = {
[ LAUNCHPAD_INTENT_WRITE ]: LaunchpadIntentWrite,
[ LAUNCHPAD_PRE_LAUNCH ]: LaunchpadPreLaunch,
[ LAUNCHPAD_LEGACY_SITE_SETUP ]: LaunchpadSiteSetup,
[ LAUNCHPAD_INTENT_NEWSLETTER_V2 ]: LaunchpadIntentNewsletterV2,
[ LAUNCHPAD_POST_MIGRATION ]: LaunchpadPostMigration,
[ NOTICE_READER_FIRST_POSTS ]: ReaderFirstPosts,
[ SECTION_BLOGGING_PROMPT ]: BloggingPrompt,
Expand Down
5 changes: 4 additions & 1 deletion client/my-sites/preview/main.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Button, Gridicon } from '@automattic/components';
import { updateLaunchpadSettings } from '@automattic/data-stores';
import { isWithinBreakpoint, isMobile, isDesktop } from '@automattic/viewport';
import debugFactory from 'debug';
import { localize } from 'i18n-calypso';
Expand Down Expand Up @@ -228,7 +229,9 @@ const ConnectedPreviewMain = ( props ) => {
);

useRequestSiteChecklistTaskUpdate( selectedSiteId, CHECKLIST_KNOWN_TASKS.BLOG_PREVIEWED );

updateLaunchpadSettings( selectedSiteId, {
checklist_statuses: { preview_site: true },
} );
return <PreviewMain { ...props } { ...stateToProps } { ...dispatchToProps } />;
};

Expand Down
1 change: 1 addition & 0 deletions packages/data-stores/src/onboard/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export enum SiteIntent {
ReadyMadeTemplate = 'readymade-template',
AIAssembler = 'ai-assembler',
Newsletter = 'newsletter',
NewsletterV2 = 'intent-newsletter-v2',
FreePostSetup = 'free-post-setup', // non-signup flow
SiteMigration = 'site-migration',
LinkInBioPostSetup = 'link-in-bio-post-setup', // non-signup flow
Expand Down
2 changes: 1 addition & 1 deletion packages/data-stores/src/onboard/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const goalsToIntent = ( goals: SiteGoal[] ): SiteIntent => {

// Newsletter flow
if ( goals.includes( SiteGoal.Newsletter ) ) {
return SiteIntent.Newsletter;
return SiteIntent.NewsletterV2;
}

return SiteIntent.Build;
Expand Down

0 comments on commit 49f0d0d

Please sign in to comment.