Skip to content

Commit d192bc3

Browse files
tianzhouclaude
andcommitted
chore: change Upgrade to Manage for paid plans with Stripe portal link
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7e8d617 commit d192bc3

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

src/components/SubscriptionModal.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ const PAYMENT_LINKS = {
3333
annual: 'https://buy.stripe.com/28E28qfoZ69zcsr2nX1Fe03',
3434
}
3535

36+
const CUSTOMER_PORTAL_LINK = 'https://billing.stripe.com/p/login/8x23cu1y969z643e6F1Fe00'
37+
3638
function formatDate(timestamp: number): string {
3739
return new Date(timestamp * 1000).toLocaleDateString(undefined, {
3840
year: 'numeric',
@@ -116,7 +118,7 @@ export function SubscriptionModalProvider({ children }: { children: React.ReactN
116118
</span>
117119
</div>
118120

119-
{isOwner && (
121+
{isOwner && plan === 'FREE' && (
120122
<div className="pt-4 border-t">
121123
<p className="text-sm font-medium text-gray-700 mb-3">Select billing cycle:</p>
122124
<div className="grid grid-cols-2 gap-3">
@@ -157,8 +159,14 @@ export function SubscriptionModalProvider({ children }: { children: React.ReactN
157159
Close
158160
</Button>
159161
{isOwner && (
160-
<Button onClick={() => window.open(PAYMENT_LINKS[billingCycle], '_blank')}>
161-
Upgrade
162+
<Button onClick={() => {
163+
let url = plan === 'FREE' ? PAYMENT_LINKS[billingCycle] : CUSTOMER_PORTAL_LINK
164+
if (plan !== 'FREE' && licenseEmail) {
165+
url += `?prefilled_email=${encodeURIComponent(licenseEmail)}`
166+
}
167+
window.open(url, '_blank')
168+
}}>
169+
{plan === 'FREE' ? 'Upgrade' : 'Manage'}
162170
</Button>
163171
)}
164172
</DialogFooter>

0 commit comments

Comments
 (0)