@@ -438,6 +438,23 @@ const UpgradePlanSection = ({
438438 ) ;
439439} ;
440440
441+ // Shown when there are no paid plans to display (e.g. a member reaches the
442+ // plans page via a theme button or deep link while the site has no paid tiers).
443+ const NoPlansAvailableMessage = ( ) => {
444+ return (
445+ < section >
446+ < div className = 'gh-portal-section' >
447+ < p
448+ className = 'gh-portal-no-plans-available-notification'
449+ data-testid = "no-plans-available-notification-text"
450+ >
451+ { t ( 'Sorry, no paid plans are available.' ) }
452+ </ p >
453+ </ div >
454+ </ section >
455+ ) ;
456+ } ;
457+
441458const PlansContainer = ( {
442459 plans, selectedPlan, confirmationPlan, confirmationType, showConfirmation = false ,
443460 pendingOffer, onPlanSelect, onPlanCheckout, onConfirm, onCancelSubscription,
@@ -446,6 +463,14 @@ const PlansContainer = ({
446463 const { member} = useContext ( AppContext ) ;
447464 // Plan upgrade flow for free, complimentary, or gift members.
448465 if ( ! isPaidMember ( { member} ) || isComplimentaryMember ( { member} ) || isGiftMember ( { member} ) ) {
466+ // No paid plans to choose from. This covers the deep-link / theme-button
467+ // entry point (#/portal/account/plans), which cannot be gated in-app,
468+ // where the body would otherwise render blank under the page header.
469+ if ( plans . length === 0 ) {
470+ return (
471+ < NoPlansAvailableMessage />
472+ ) ;
473+ }
449474 return (
450475 < UpgradePlanSection
451476 { ...{ plans, selectedPlan, onPlanSelect, onPlanCheckout} }
0 commit comments