File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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+
3638function 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 >
You can’t perform that action at this time.
0 commit comments