Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/bright-brooms-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/clerk-js': patch
---

Fix issue where free plans had a monthly/annual toggle.
2 changes: 1 addition & 1 deletion packages/clerk-js/src/ui/components/Plans/PlanDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ const Header = React.forwardRef<HTMLDivElement, HeaderProps>((props, ref) => {
</>
</Flex>

{plan.annualMonthlyFee ? (
{plan.annualMonthlyFee && !plan.isDefault ? (
<Box
elementDescriptor={descriptors.planDetailPeriodToggle}
sx={t => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ const CardHeader = React.forwardRef<HTMLDivElement, CardHeaderProps>((props, ref
) : null}
</Flex>

{planSupportsAnnual && setPlanPeriod ? (
{planSupportsAnnual && !plan.isDefault && setPlanPeriod ? (
<Box
elementDescriptor={descriptors.pricingTableCardPeriodToggle}
sx={t => ({
Expand Down
2 changes: 1 addition & 1 deletion packages/clerk-js/src/ui/contexts/components/Plans.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export const usePlansContext = () => {
const subscription =
sub ?? (plan ? activeOrUpcomingSubscriptionWithPlanPeriod(plan, selectedPlanPeriod) : undefined);
let _selectedPlanPeriod = selectedPlanPeriod;
const isEligibleForSwitchToAnnual = Boolean(plan?.annualMonthlyFee);
const isEligibleForSwitchToAnnual = Boolean(plan?.annualMonthlyFee && !plan.isDefault);

if (_selectedPlanPeriod === 'annual' && !isEligibleForSwitchToAnnual) {
_selectedPlanPeriod = 'month';
Expand Down
Loading