Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 470
refactor(clerk-js): Add localization support to commerce components#5390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
alexcarpenter
merged 6 commits into
main
from
alexcarpenter/refactor-commerce-to-support-localizationMar 18, 2025
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
43d7295
refactor(clerk-js): Add localization support to commerce components
alexcarpenter dfcbfe6
add changeset
alexcarpenter aed0b08
use string | LocalizationKey approach
alexcarpenter 3640d41
remove
alexcarpenter 6561d78
remove optional
alexcarpenter 0b1a31f
Update PlanCard.tsx
alexcarpenter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@clerk/clerk-js': patch | ||
| --- | ||
| Add support for localizationKeys within commerce components. |
39 changes: 22 additions & 17 deletions
39 packages/clerk-js/src/ui/components/Checkout/CheckoutComplete.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 19 additions & 23 deletions
42 packages/clerk-js/src/ui/components/Checkout/CheckoutForm.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 10 additions & 2 deletions
12 packages/clerk-js/src/ui/components/PricingTable/PlanCard.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -325,8 +325,16 @@ export const PlanCardHeader = React.forwardRef<HTMLDivElement, PlanCardHeaderPro | ||
| value={planPeriod} | ||
| onChange={value => setPlanPeriod(value as PlanPeriod)} | ||
| > | ||
| <SegmentedControl.Button value='month'>Monthly</SegmentedControl.Button> | ||
| <SegmentedControl.Button value='annual'>Annually</SegmentedControl.Button> | ||
| <SegmentedControl.Button | ||
| value='month' | ||
| // TODO(@Commerce): needs localization | ||
| text='Monthly' | ||
| /> | ||
| <SegmentedControl.Button | ||
| value='annual' | ||
| // TODO(@Commerce): needs localization | ||
| text='Annually' | ||
alexcarpenter marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| /> | ||
| </SegmentedControl.Root> | ||
| </Box> | ||
| ) : null} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -14,6 +14,7 @@ import { | ||
| import * as React from 'react'; | ||
| import { transitionDurationValues, transitionTiming } from '../../ui/foundations/transitions'; | ||
| import type { LocalizationKey } from '../customizables'; | ||
| import { Box, descriptors, Flex, Heading, Icon, Span, useAppearance } from '../customizables'; | ||
| import { usePrefersReducedMotion } from '../hooks'; | ||
| import { useScrollLock } from '../hooks/useScrollLock'; | ||
| @@ -263,7 +264,7 @@ Overlay.displayName = 'Drawer.Content'; | ||
| * -----------------------------------------------------------------------------------------------*/ | ||
| interface HeaderProps { | ||
| title?: string; | ||
| title?: string | LocalizationKey; | ||
| children?: React.ReactNode; | ||
| sx?: ThemableCssProp; | ||
| } | ||
| @@ -295,15 +296,14 @@ const Header = React.forwardRef<HTMLDivElement, HeaderProps>(({ title, children, | ||
| {title ? ( | ||
| <> | ||
| <Heading | ||
| localizationKey={title} | ||
| as='h2' | ||
| elementDescriptor={descriptors.drawerTitle} | ||
| textVariant='h2' | ||
| sx={{ | ||
| alignSelf: 'center', | ||
| }} | ||
| > | ||
| {title} | ||
| </Heading> | ||
| /> | ||
| <Close /> | ||
| </> | ||
| ) : ( | ||
| @@ -416,6 +416,9 @@ interface ConfirmationProps { | ||
| onOpenChange: (open: boolean) => void; | ||
| children: React.ReactNode; | ||
| actionsSlot: React.ReactNode; | ||
| /** | ||
| * @see https://floating-ui.com/docs/userole | ||
| */ | ||
alexcarpenter marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| roleProps?: UseRoleProps; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.