Skip to content

Commit

Permalink
Remove custom flows for Sell and Write
Browse files Browse the repository at this point in the history
  • Loading branch information
p-jackson committed Jan 12, 2025
1 parent 072c357 commit 4e9a6eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 47 deletions.
43 changes: 6 additions & 37 deletions client/landing/stepper/declarative-flow/site-setup-flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { getInitialQueryArguments } from 'calypso/state/selectors/get-initial-qu
import { setActiveTheme, activateOrInstallThenActivate } from 'calypso/state/themes/actions';
import { getActiveTheme, getCanonicalTheme } from 'calypso/state/themes/selectors';
import { WRITE_INTENT_DEFAULT_DESIGN } from '../constants';
import { useIsGoalsHoldout } from '../hooks/use-is-goals-holdout';
import { useIsPluginBundleEligible } from '../hooks/use-is-plugin-bundle-eligible';
import { useSiteData } from '../hooks/use-site-data';
import { useCanUserManageOptions } from '../hooks/use-user-can-manage-options';
Expand Down Expand Up @@ -95,8 +94,6 @@ const siteSetupFlow: Flow = {
return steps;
},
useStepNavigation( currentStep, navigate ) {
const isGoalsHoldout = useIsGoalsHoldout( currentStep );

const intent = useSelect(
( select ) => ( select( ONBOARD_STORE ) as OnboardSelect ).getIntent(),
[]
Expand All @@ -110,10 +107,6 @@ const siteSetupFlow: Flow = {
( select ) => ( select( ONBOARD_STORE ) as OnboardSelect ).getSelectedDesign(),
[]
);
const startingPoint = useSelect(
( select ) => ( select( ONBOARD_STORE ) as OnboardSelect ).getStartingPoint(),
[]
);

const { site, siteSlug, siteId } = useSiteData();
const isSitePlanCompatible = site && isTargetSitePlanCompatible( site );
Expand Down Expand Up @@ -280,15 +273,6 @@ const siteSetupFlow: Flow = {
return navigate( 'error' );
}

// If the user skips starting point, redirect them to the post editor
if ( isGoalsHoldout && intent === 'write' && startingPoint !== 'skip-to-my-home' ) {
if ( startingPoint !== 'write' ) {
window.sessionStorage.setItem( 'wpcom_signup_complete_show_draft_post_modal', '1' );
}

return exitFlow( `/post/${ siteSlug }` );
}

// End of woo flow
if ( intent === 'sell' && storeType === 'power' ) {
dispatch( recordTracksEvent( 'calypso_woocommerce_dashboard_redirect' ) );
Expand Down Expand Up @@ -354,12 +338,6 @@ const siteSetupFlow: Flow = {
case SiteIntent.DIFM:
return navigate( 'difmStartingPoint' );

case SiteIntent.Write:
case SiteIntent.Sell:
// If we're not in the holdout, intentionally fall through to the default case
if ( isGoalsHoldout ) {
return navigate( 'options' );
}
default: {
if ( isDesignChoicesStepEnabled ) {
return navigate( 'design-choices' );
Expand Down Expand Up @@ -510,22 +488,13 @@ const siteSetupFlow: Flow = {
return navigate( 'bloggerStartingPoint' );

case 'designSetup':
switch ( intent ) {
case SiteIntent.DIFM:
return navigate( 'difmStartingPoint' );
case SiteIntent.Write:
case SiteIntent.Sell:
// If we're not in the holdout, intentionally fall through to the default case
if ( isGoalsHoldout ) {
return navigate( 'options' );
}
default: {
if ( isDesignChoicesStepEnabled ) {
return navigate( 'design-choices' );
}
return navigate( 'goals' );
}
if ( intent === SiteIntent.DIFM ) {
return navigate( 'difmStartingPoint' );
}
if ( isDesignChoicesStepEnabled ) {
return navigate( 'design-choices' );
}
return navigate( 'goals' );

case 'design-choices': {
return navigate( 'goals' );
Expand Down
10 changes: 0 additions & 10 deletions client/landing/stepper/hooks/use-is-goals-holdout.tsx

This file was deleted.

0 comments on commit 4e9a6eb

Please sign in to comment.