|
|
import { |
|
|
PERSONAL_THEME, |
|
|
PREMIUM_THEME, |
|
|
DOT_ORG_THEME, |
|
|
BUNDLED_THEME, |
|
|
MARKETPLACE_THEME, |
|
|
} from '@automattic/design-picker'; |
|
|
import { PlansIntent } from '@automattic/plans-grid-next'; |
|
|
|
|
|
|
|
|
export const shouldForceDefaultPlansBasedOnIntent = ( intent: PlansIntent | undefined ) => { |
|
|
return ( |
|
|
intent && |
|
|
[ |
|
|
'plans-guided-segment-merchant', |
|
|
'plans-guided-segment-blogger', |
|
|
'plans-guided-segment-nonprofit', |
|
|
'plans-guided-segment-consumer-or-business', |
|
|
'plans-guided-segment-developer-or-agency', |
|
|
].includes( intent ) |
|
|
); |
|
|
}; |
|
|
|
|
|
export const hideEscapeHatchForIntent = ( intent: PlansIntent ) => { |
|
|
return intent === 'plans-ai-assembler-free-trial'; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export const getHidePlanPropsBasedOnThemeType = ( themeType: string ) => { |
|
|
|
|
|
|
|
|
|
|
|
if ( |
|
|
themeType === DOT_ORG_THEME || |
|
|
themeType === MARKETPLACE_THEME || |
|
|
themeType === BUNDLED_THEME |
|
|
) { |
|
|
return { hidePremiumPlan: true, hidePersonalPlan: true, hideFreePlan: true }; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( themeType === PREMIUM_THEME ) { |
|
|
return { hidePersonalPlan: true, hideFreePlan: true }; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( themeType === PERSONAL_THEME ) { |
|
|
return { hideFreePlan: true }; |
|
|
} |
|
|
|
|
|
return {}; |
|
|
}; |
|
|
|