Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

update pricing table logic

Steven Tey3b83de41961f
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/billing/upgrade/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/billing/upgrade/page-client.tsx
index 70344cceb5..d6b34cd8e4 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/billing/upgrade/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/billing/upgrade/page-client.tsx
@@ -89,11 +89,15 @@ export function WorkspaceBillingUpgradePageClient() {
}
>
{plans.map((plan, idx) => {
- const disabledCurrentPlan =
- plan.name.toLowerCase() === currentPlan && !stripeId;
- const isDowngrade = isDowngradePlan(
- currentPlan || "free",
- plan.name,
+ // disable upgrade button if user has a Stripe ID and is on the current plan
+ // (if there's no stripe id, they could be on a free trial so they should be able to upgrade)
+ const disableCurrentPlan = Boolean(
+ stripeId && plan.name.toLowerCase() === currentPlan,
+ );
+
+ // show downgrade button if user has a stripe id and is on the current plan
+ const isDowngrade = Boolean(
+ stripeId && isDowngradePlan(currentPlan || "free", plan.name),
);
return (
@@ -162,13 +166,13 @@ export function WorkspaceBillingUpgradePageClient() {
<UpgradePlanButton
plan={plan.name.toLowerCase()}
period={period}
- disabled={disabledCurrentPlan}
+ disabled={disableCurrentPlan}
text={
- disabledCurrentPlan
+ disableCurrentPlan
? "Current plan"
: isDowngrade
? "Downgrade"
- : "Get started"
+ : "Upgrade"
}
variant={isDowngrade ? "secondary" : "primary"}
className="h-8 shadow-sm"
diff --git a/packages/utils/src/constants/plan-compare.tsx b/packages/utils/src/constants/plan-compare.tsx
index adb7c6a39b..15d3e418ed 100644
--- a/packages/utils/src/constants/plan-compare.tsx
+++ b/packages/utils/src/constants/plan-compare.tsx
@@ -134,6 +134,14 @@ export const PLAN_COMPARE_FEATURES: {
text: "Geo targeting",
href: "https://dub.co/help/article/geo-targeting",
},
+ {
+ check: {
+ free: false,
+ default: true,
+ },
+ text: "Deep links",
+ href: "https://dub.co/help/article/custom-domain-deep-links",
+ },
],
},
{