Skip to content

Commit 152e35d

Browse files
committed
Localize text
1 parent 6c8f205 commit 152e35d

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

packages/template-retail-react-app/app/components/passkey-registration-modal/index.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ const PasskeyRegistrationModal = ({isOpen, onClose}) => {
5050
const form = useForm()
5151

5252
const config = getConfig()
53-
const commerceApiConfig = config.app.commerceAPI
5453
const webauthnConfig = config.app.login.passkey
5554
const authorizeWebauthnRegistration = useAuthHelper(AuthHelpers.AuthorizeWebauthnRegistration)
5655

@@ -62,7 +61,6 @@ const PasskeyRegistrationModal = ({isOpen, onClose}) => {
6261
await authorizeWebauthnRegistration.mutateAsync({
6362
user_id: customer.email,
6463
mode: webauthnConfig.mode,
65-
channel_id: commerceApiConfig.parameters.siteId,
6664
...(webauthnConfig.mode === 'callback' && {
6765
callback_uri: webauthnConfig.callbackURI
6866
})
@@ -130,7 +128,7 @@ const PasskeyRegistrationModal = ({isOpen, onClose}) => {
130128
<FormControl>
131129
<FormLabel>
132130
{formatMessage({
133-
defaultMessage: 'Passkey Nickname',
131+
defaultMessage: 'Passkey Nickname (optional)',
134132
id: 'auth_modal.passkey.label.nickname'
135133
})}
136134
</FormLabel>

packages/template-retail-react-app/app/hooks/use-passkey-registration.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
import React from 'react'
9+
import {useIntl} from 'react-intl'
910
import {
1011
Box,
1112
Button,
@@ -21,6 +22,7 @@ import {usePasskeyRegistrationContext} from '@salesforce/retail-react-app/app/co
2122
export const usePasskeyRegistration = () => {
2223
const toast = useToast()
2324
const {passkeyModal} = usePasskeyRegistrationContext()
25+
const {formatMessage} = useIntl()
2426

2527
const showToast = () => {
2628
toast({
@@ -43,10 +45,16 @@ export const usePasskeyRegistration = () => {
4345
top={2}
4446
color="white"
4547
onClick={onClose}
46-
aria-label="Close toast"
48+
aria-label={formatMessage({
49+
id: 'passkey_registration.toast.button.close.assistive_msg',
50+
defaultMessage: 'Close toast'
51+
})}
4752
/>
4853
<Box mb={3} fontWeight="medium">
49-
Create a passkey for a more secure and easier login
54+
{formatMessage({
55+
id: 'passkey_registration.toast.message',
56+
defaultMessage: 'Create a passkey for a more secure and easier login'
57+
})}
5058
</Box>
5159
<Button
5260
size="sm"
@@ -56,7 +64,10 @@ export const usePasskeyRegistration = () => {
5664
passkeyModal.onOpen()
5765
}}
5866
>
59-
Create Passkey
67+
{formatMessage({
68+
id: 'passkey_registration.toast.button.create',
69+
defaultMessage: 'Create Passkey'
70+
})}
6071
</Button>
6172
</Box>
6273
)

0 commit comments

Comments
 (0)