File tree Expand file tree Collapse file tree 3 files changed +51
-27
lines changed
src/pages/PlanPage/subRoutes/UpgradePlanPage/UpgradeForm/Controllers
ProPlanController/BillingOptions
SentryPlanController/BillingOptions
TeamPlanController/BillingOptions Expand file tree Collapse file tree 3 files changed +51
-27
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,11 @@ const BillingControls: React.FC<BillingControlsProps> = ({
6262 ? proPlanMonth ?. billingRate
6363 : proPlanYear ?. billingRate
6464
65+ // Don't render if no corresponding plans are available
66+ if ( ! proPlanMonth && ! proPlanYear ) {
67+ return null
68+ }
69+
6570 return (
6671 < div className = "flex w-fit flex-col gap-2" >
6772 < h3 className = "font-semibold" > Step 2: Choose a billing cycle</ h3 >
@@ -78,7 +83,7 @@ const BillingControls: React.FC<BillingControlsProps> = ({
7883 setOption ( value )
7984 } }
8085 >
81- { currentPlanBillingRate === BillingRate . ANNUALLY && (
86+ { currentPlanBillingRate === BillingRate . ANNUALLY && proPlanYear && (
8287 < RadioTileGroup . Item
8388 value = { TimePeriods . ANNUAL }
8489 className = "w-32"
@@ -87,13 +92,15 @@ const BillingControls: React.FC<BillingControlsProps> = ({
8792 < RadioTileGroup . Label > { TimePeriods . ANNUAL } </ RadioTileGroup . Label >
8893 </ RadioTileGroup . Item >
8994 ) }
90- < RadioTileGroup . Item
91- value = { TimePeriods . MONTHLY }
92- className = "w-32"
93- data-testid = "radio-monthly"
94- >
95- < RadioTileGroup . Label > { TimePeriods . MONTHLY } </ RadioTileGroup . Label >
96- </ RadioTileGroup . Item >
95+ { proPlanMonth && (
96+ < RadioTileGroup . Item
97+ value = { TimePeriods . MONTHLY }
98+ className = "w-32"
99+ data-testid = "radio-monthly"
100+ >
101+ < RadioTileGroup . Label > { TimePeriods . MONTHLY } </ RadioTileGroup . Label >
102+ </ RadioTileGroup . Item >
103+ ) }
97104 </ RadioTileGroup >
98105 < p >
99106 { baseUnitPrice !== undefined && (
Original file line number Diff line number Diff line change @@ -63,6 +63,11 @@ const BillingControls: React.FC<BillingControlsProps> = ({
6363 ? sentryPlanMonth ?. billingRate
6464 : sentryPlanYear ?. billingRate
6565
66+ // Don't render if no corresponding plans are available
67+ if ( ! sentryPlanMonth && ! sentryPlanYear ) {
68+ return null
69+ }
70+
6671 return (
6772 < div className = "flex w-fit flex-col gap-2" >
6873 < h3 className = "font-semibold" > Step 2: Choose a billing cycle</ h3 >
@@ -79,22 +84,27 @@ const BillingControls: React.FC<BillingControlsProps> = ({
7984 setOption ( value )
8085 } }
8186 >
82- { currentPlanBillingRate === BillingRate . ANNUALLY && (
87+ { currentPlanBillingRate === BillingRate . ANNUALLY &&
88+ sentryPlanYear && (
89+ < RadioTileGroup . Item
90+ value = { TimePeriods . ANNUAL }
91+ className = "w-32"
92+ data-testid = "radio-annual"
93+ >
94+ < RadioTileGroup . Label >
95+ { TimePeriods . ANNUAL }
96+ </ RadioTileGroup . Label >
97+ </ RadioTileGroup . Item >
98+ ) }
99+ { sentryPlanMonth && (
83100 < RadioTileGroup . Item
84- value = { TimePeriods . ANNUAL }
101+ value = { TimePeriods . MONTHLY }
85102 className = "w-32"
86- data-testid = "radio-annual "
103+ data-testid = "radio-monthly "
87104 >
88- < RadioTileGroup . Label > { TimePeriods . ANNUAL } </ RadioTileGroup . Label >
105+ < RadioTileGroup . Label > { TimePeriods . MONTHLY } </ RadioTileGroup . Label >
89106 </ RadioTileGroup . Item >
90107 ) }
91- < RadioTileGroup . Item
92- value = { TimePeriods . MONTHLY }
93- className = "w-32"
94- data-testid = "radio-monthly"
95- >
96- < RadioTileGroup . Label > { TimePeriods . MONTHLY } </ RadioTileGroup . Label >
97- </ RadioTileGroup . Item >
98108 </ RadioTileGroup >
99109 < p >
100110 { baseUnitPrice !== undefined && (
Original file line number Diff line number Diff line change @@ -62,6 +62,11 @@ const BillingControls: React.FC<BillingControlsProps> = ({
6262 ? teamPlanMonth ?. billingRate
6363 : teamPlanYear ?. billingRate
6464
65+ // Don't render if no corresponding plans are available
66+ if ( ! teamPlanMonth && ! teamPlanYear ) {
67+ return null
68+ }
69+
6570 return (
6671 < div className = "flex w-fit flex-col gap-2" >
6772 < h3 className = "font-semibold" > Step 2: Choose a billing cycle</ h3 >
@@ -78,7 +83,7 @@ const BillingControls: React.FC<BillingControlsProps> = ({
7883 setOption ( value )
7984 } }
8085 >
81- { currentPlanBillingRate === BillingRate . ANNUALLY && (
86+ { currentPlanBillingRate === BillingRate . ANNUALLY && teamPlanYear && (
8287 < RadioTileGroup . Item
8388 value = { TimePeriods . ANNUAL }
8489 className = "w-32"
@@ -87,13 +92,15 @@ const BillingControls: React.FC<BillingControlsProps> = ({
8792 < RadioTileGroup . Label > { TimePeriods . ANNUAL } </ RadioTileGroup . Label >
8893 </ RadioTileGroup . Item >
8994 ) }
90- < RadioTileGroup . Item
91- value = { TimePeriods . MONTHLY }
92- className = "w-32"
93- data-testid = "radio-monthly"
94- >
95- < RadioTileGroup . Label > { TimePeriods . MONTHLY } </ RadioTileGroup . Label >
96- </ RadioTileGroup . Item >
95+ { teamPlanMonth && (
96+ < RadioTileGroup . Item
97+ value = { TimePeriods . MONTHLY }
98+ className = "w-32"
99+ data-testid = "radio-monthly"
100+ >
101+ < RadioTileGroup . Label > { TimePeriods . MONTHLY } </ RadioTileGroup . Label >
102+ </ RadioTileGroup . Item >
103+ ) }
97104 </ RadioTileGroup >
98105 < p >
99106 { baseUnitPrice !== undefined && (
You can’t perform that action at this time.
0 commit comments