Skip to content

Commit 240a7b8

Browse files
committed
Add close button to toast
1 parent 319d109 commit 240a7b8

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import React from 'react'
99
import {
1010
Box,
1111
Button,
12+
CloseButton,
1213
useDisclosure,
1314
useToast
1415
} from '@salesforce/retail-react-app/app/components/shared/ui'
@@ -26,15 +27,24 @@ export const usePasskeyRegistration = () => {
2627
position: 'top-right',
2728
duration: 9000,
2829
isClosable: true,
29-
render: () => (
30+
render: ({onClose}) => (
3031
<Box
3132
color="white"
3233
p={4}
3334
bg="green.500"
3435
borderRadius="md"
3536
boxShadow="lg"
3637
maxWidth="400px"
38+
position="relative"
3739
>
40+
<CloseButton
41+
position="absolute"
42+
right={2}
43+
top={2}
44+
color="white"
45+
onClick={onClose}
46+
aria-label="Close toast"
47+
/>
3848
<Box mb={3} fontWeight="medium">
3949
Create a passkey for a more secure and easier login
4050
</Box>

0 commit comments

Comments
 (0)