Skip to content

Conversation

@alexcarpenter
Copy link
Member

@alexcarpenter alexcarpenter commented Mar 14, 2025

Description

Refactoring <Checkout /> components to connect descriptors and theming.

Resolves COM-137

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@changeset-bot
Copy link

changeset-bot bot commented Mar 14, 2025

🦋 Changeset detected

Latest commit: 50c1b52

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 22 packages
Name Type
@clerk/clerk-js Patch
@clerk/types Patch
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch
@clerk/agent-toolkit Patch
@clerk/astro Patch
@clerk/backend Patch
@clerk/elements Patch
@clerk/expo-passkeys Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/localizations Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/clerk-react Patch
@clerk/remix Patch
@clerk/shared Patch
@clerk/tanstack-start Patch
@clerk/testing Patch
@clerk/themes Patch
@clerk/vue Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Mar 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 18, 2025 0:43am

@alexcarpenter alexcarpenter changed the title feat(clerk-js): Refactor <CheckoutPage /> implementation feat(clerk-js): Refactor <Checkout /> components Mar 17, 2025
*/
export type ElementsConfig = {
button: WithOptions;
button: WithOptions<string>;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we introduce a commerceButton that has the supported providers typed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In what ways is button different that commerceButton ? Would you ever only want to target this while exluding any other button ?

Copy link
Member Author

@alexcarpenter alexcarpenter Mar 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its not, just looking for a way for folks to target the specific commerce provider buttons, similar to what we do with socialButtons. The question is whether I should follow the socialButtons approach or just expose setting and elementId on the button descriptor.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can do paymentButtons but i think you still need to use elementIds.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, is that the preferred approach vs opening button to accept elementIds?

@alexcarpenter alexcarpenter changed the title feat(clerk-js): Refactor <Checkout /> components feat(clerk-js,types): Refactor <Checkout /> components Mar 17, 2025
@alexcarpenter alexcarpenter marked this pull request as ready for review March 17, 2025 17:43
</LineItems.Description>
</LineItems.Group>
<LineItems.Group borderTop>
<LineItems.Title>Total{totals.totalDueNow ? ' Due Today' : ''}</LineItems.Title>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<LineItems.Title>Total{totals.totalDueNow ? ' Due Today' : ''}</LineItems.Title>
{/* TODO(@COMMERCE): needs localization */}
<LineItems.Title>Total{totals.totalDueNow ? ' Due Today' : ''}</LineItems.Title>

</LineItems.Description>
</LineItems.Group>
<LineItems.Group variant='tertiary'>
<LineItems.Title>Tax</LineItems.Title>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<LineItems.Title>Tax</LineItems.Title>
{/* TODO(@COMMERCE): needs localization */}
<LineItems.Title>Tax</LineItems.Title>

borderTop
variant='tertiary'
>
<LineItems.Title>Subtotal</LineItems.Title>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<LineItems.Title>Subtotal</LineItems.Title>
{/* TODO(@COMMERCE): needs localization */}
<LineItems.Title>Subtotal</LineItems.Title>

<LineItems.Root>
<LineItems.Group>
<LineItems.Title>{plan.name}</LineItems.Title>
<LineItems.Description suffix={`per month${planPeriod === 'annual' ? ', times 12 months' : ''}`}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{/* TODO(@Commerce): needs localization */}

Suggested change
<LineItems.Description suffix={`per month${planPeriod === 'annual' ? ', times 12 months' : ''}`}>
<LineItems.Description suffix={`per month${planPeriod === 'annual' ? ', times 12 months' : ''}`}>

<LineItems.Root>
<LineItems.Group>
<LineItems.Title>{plan.name}</LineItems.Title>
<LineItems.Description suffix={`per month${planPeriod === 'annual' ? ', times 12 months' : ''}`}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{/* TODO(@Commerce): needs localization */}

Suggested change
<LineItems.Description suffix={`per month${planPeriod === 'annual' ? ', times 12 months' : ''}`}>
<LineItems.Description suffix={`per month${planPeriod === 'annual' ? ', times 12 months' : ''}`}>

<Drawer.Body>
<CheckoutPage {...props} />
</Drawer.Body>
<CheckoutPage {...props} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that tying the checkout page to be always in a drawer? Do we want users to be able to embed this onto a separate page?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<Checkout /> would be what the user implements on the page which always renders in the <Drawer />.

@alexcarpenter alexcarpenter merged commit 1a61390 into main Mar 18, 2025
30 checks passed
@alexcarpenter alexcarpenter deleted the alexcarpenter/refactor-checkout-page branch March 18, 2025 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants