Skip to content

Commit

Permalink
[sparkle] - refactor: use composability for SheetClose with Button
Browse files Browse the repository at this point in the history
 - Wrap Button components in SheetClose with `asChild` prop to leverage composability
 - Ensure SheetClose component can act as a parent without affecting button functionality
  • Loading branch information
JulesBelveze committed Nov 28, 2024
1 parent 03b3668 commit bc6a5e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sparkle/src/components/Sheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@ const SheetFooter = ({
(leftButtonProps.disabled ? (
<Button {...leftButtonProps} />
) : (
<SheetClose className={sheetCloseClassName}>
<SheetClose className={sheetCloseClassName} asChild>
<Button {...leftButtonProps} />
</SheetClose>
))}
{rightButtonProps &&
(rightButtonProps.disabled ? (
<Button {...rightButtonProps} />
) : (
<SheetClose className={sheetCloseClassName}>
<SheetClose className={sheetCloseClassName} asChild>
<Button {...rightButtonProps} />
</SheetClose>
))}
Expand Down

0 comments on commit bc6a5e9

Please sign in to comment.