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/stupid-animals-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/clerk-js': patch
---

Adjusts the order and layout of the checkout form's line items
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,6 @@ export const CheckoutComplete = ({ checkout }: { checkout: __experimental_Commer
}
/>
</LineItems.Group>
<LineItems.Group variant='tertiary'>
<LineItems.Title title={localizationKeys('__experimental_commerce.checkout.lineItems.title__invoiceId')} />
<LineItems.Description
text={checkout.invoice_id || '–'}
truncateText
copyText
copyLabel='Copy invoice ID'
/>
</LineItems.Group>
</LineItems.Root>
<Button
onClick={handleClose}
Expand Down
28 changes: 10 additions & 18 deletions packages/clerk-js/src/ui/components/Checkout/CheckoutForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,33 +67,25 @@ export const CheckoutForm = ({
suffix={`per month${planPeriod === 'annual' ? ', times 12 months' : ''}`}
/>
</LineItems.Group>
<LineItems.Group
borderTop
variant='tertiary'
>
{/* TODO(@Commerce): needs localization */}
<LineItems.Title title='Subtotal' />
<LineItems.Description text={`${totals.subtotal.currencySymbol}${totals.subtotal.amountFormatted}`} />
</LineItems.Group>
{showCredits && (
<LineItems.Group>
<LineItems.Group variant='tertiary'>
{/* TODO(@Commerce): needs localization */}
<LineItems.Title
title={'Credit'}
description={'Prorated credit for the remainder of your subscription.'}
/>
<LineItems.Title title={'Credit for the remainder of your current subscription.'} />
{/* TODO(@Commerce): needs localization */}
{/* TODO(@Commerce): Replace client-side calculation with server-side calculation once data are available in the response */}
<LineItems.Description
text={`- ${totals.proration?.credit.currencySymbol}${totals.proration?.credit.amountFormatted}`}
/>
</LineItems.Group>
)}
<LineItems.Group
borderTop
variant='tertiary'
>
{/* TODO(@Commerce): needs localization */}
<LineItems.Title title='Subtotal' />
<LineItems.Description text={`${totals.subtotal.currencySymbol} ${totals.subtotal.amountFormatted}`} />
</LineItems.Group>
<LineItems.Group variant='tertiary'>
{/* TODO(@Commerce): needs localization */}
<LineItems.Title title='Tax' />
<LineItems.Description text={`${totals.taxTotal.currencySymbol} ${totals.taxTotal.amountFormatted}`} />
</LineItems.Group>
<LineItems.Group borderTop>
{/* TODO(@Commerce): needs localization */}
<LineItems.Title title={`Total Due Today`} />
Expand Down