From 13da6bfaaa69e7058ee0a1df8eb5efdff70cbcdf Mon Sep 17 00:00:00 2001 From: Christos Date: Wed, 20 Nov 2024 10:12:15 +0200 Subject: [PATCH] enable term-savings via experiment --- client/my-sites/plans-features-main/index.tsx | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/client/my-sites/plans-features-main/index.tsx b/client/my-sites/plans-features-main/index.tsx index 577977ffd6335..25af78125d827 100644 --- a/client/my-sites/plans-features-main/index.tsx +++ b/client/my-sites/plans-features-main/index.tsx @@ -69,6 +69,7 @@ import ComparisonGridToggle from './components/comparison-grid-toggle'; import PlanUpsellModal from './components/plan-upsell-modal'; import { useModalResolutionCallback } from './components/plan-upsell-modal/hooks/use-modal-resolution-callback'; import PlansPageSubheader from './components/plans-page-subheader'; +import useLongerPlanTermDefaultExperiment from './hooks/experiments/use-longer-plan-term-default-experiment'; import useCheckPlanAvailabilityForPurchase from './hooks/use-check-plan-availability-for-purchase'; import useDefaultWpcomPlansIntent from './hooks/use-default-wpcom-plans-intent'; import useFilteredDisplayedIntervals from './hooks/use-filtered-displayed-intervals'; @@ -242,6 +243,8 @@ const PlansFeaturesMain = ( { const showUpgradeableStorage = config.isEnabled( 'plans/upgradeable-storage' ); const getPlanTypeDestination = usePlanTypeDestinationCallback(); + const longerPlanTermDefaultExperiment = useLongerPlanTermDefaultExperiment(); + const resolveModal = useModalResolutionCallback( { isCustomDomainAllowedOnFreePlan, flowName, @@ -636,7 +639,8 @@ const PlansFeaturesMain = ( { ! intent || ! defaultWpcomPlansIntent || // this may be unnecessary, but just in case ! gridPlansForFeaturesGrid || - ! gridPlansForComparisonGrid + ! gridPlansForComparisonGrid || + longerPlanTermDefaultExperiment.isLoadingExperiment ); const isPlansGridReady = ! isLoadingGridPlans && ! resolvedSubdomainName.isLoading; @@ -842,9 +846,10 @@ const PlansFeaturesMain = ( { enableReducedFeatureGroupSpacing={ showSimplifiedFeatures } enableLogosOnlyForEnterprisePlan={ showSimplifiedFeatures } hideFeatureGroupTitles={ showSimplifiedFeatures } - enableTermSavingsPriceDisplay={ isEnabled( - 'plans/term-savings-price-display' - ) } + enableTermSavingsPriceDisplay={ + isEnabled( 'plans/term-savings-price-display' ) || + longerPlanTermDefaultExperiment.isEligibleForTermSavings + } /> ) } { showEscapeHatch && hidePlansFeatureComparison && viewAllPlansButton } @@ -904,9 +909,10 @@ const PlansFeaturesMain = ( { } enableFeatureTooltips featureGroupMap={ featureGroupMapForComparisonGrid } - enableTermSavingsPriceDisplay={ isEnabled( - 'plans/term-savings-price-display' - ) } + enableTermSavingsPriceDisplay={ + isEnabled( 'plans/term-savings-price-display' ) || + longerPlanTermDefaultExperiment.isEligibleForTermSavings + } /> ) }