Skip to content

Commit 08e1db7

Browse files
committed
[dashboard] access invoices after cancellation
1 parent 0379dda commit 08e1db7

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

components/dashboard/src/components/UsageBasedBillingConfig.tsx

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,18 @@ export default function UsageBasedBillingConfig({ attributionId }: Props) {
299299
</span>
300300
</div>
301301
</div>
302-
<button className="mt-5 self-end" onClick={() => setShowBillingSetupModal(true)}>
303-
Upgrade Plan
304-
</button>
302+
<div className="flex">
303+
{stripePortalUrl && (
304+
<a className="mt-5" href={stripePortalUrl}>
305+
<button className="secondary" disabled={!stripePortalUrl}>
306+
View Past Invoices ↗
307+
</button>
308+
</a>
309+
)}
310+
<button className="mt-5 self-end" onClick={() => setShowBillingSetupModal(true)}>
311+
Upgrade Plan
312+
</button>
313+
</div>
305314
</div>
306315
)}
307316
{showUpgradeUser && (
@@ -343,7 +352,14 @@ export default function UsageBasedBillingConfig({ attributionId }: Props) {
343352
</span>
344353
</div>
345354
</div>
346-
<div className="mt-5 flex flex-col">
355+
<div className="mt-5 flex">
356+
{stripePortalUrl && (
357+
<a className="mt-5" href={stripePortalUrl}>
358+
<button className="secondary" disabled={!stripePortalUrl}>
359+
View Past Invoices ↗
360+
</button>
361+
</a>
362+
)}
347363
<button className="self-end" onClick={() => setShowBillingSetupModal(true)}>
348364
Upgrade Plan
349365
</button>

0 commit comments

Comments
 (0)