From 1254136b9759bc6983bc834a04094f72e7b7b12e Mon Sep 17 00:00:00 2001 From: snehasishcodes Date: Sat, 5 Sep 2026 00:29:09 +0530 Subject: [PATCH] fix(mobile): prevent paywall crash when switching billing cycle --- apps/mobile/components/PaywallSheet.tsx | 34 +++++++++++++++---------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/apps/mobile/components/PaywallSheet.tsx b/apps/mobile/components/PaywallSheet.tsx index 17d7cc2..eddeeff 100644 --- a/apps/mobile/components/PaywallSheet.tsx +++ b/apps/mobile/components/PaywallSheet.tsx @@ -103,20 +103,26 @@ export function PaywallSheet() { {copy.description} - {(["monthly", "yearly"] as BillingCycle[]).map((c) => ( - setCycle(c)} - className={cn( - "flex-1 items-center rounded-full py-2", - cycle === c && "bg-card shadow-sm" - )} - > - - {c === "yearly" ? "Yearly · save ~17%" : "Monthly"} - - - ))} + {(["monthly", "yearly"] as BillingCycle[]).map((c) => { + const selected = cycle === c + return ( + setCycle(c)} + accessibilityRole="tab" + accessibilityState={{ selected }} + className="flex-1 items-center rounded-full py-2" + style={{ backgroundColor: selected ? THEME[theme].card : "transparent" }} + > + + {c === "yearly" ? "Yearly · save ~17%" : "Monthly"} + + + ) + })}