Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhabib committed Dec 5, 2024
1 parent d45d0d2 commit 02ae1fe
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ import { style } from '@vanilla-extract/css';

export const wrapperPositioning = style({
margin: '-1px -6px',
width: 'fit-content',
});
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,28 @@ export const OverflowMenu = ({
id,
...menuProps
}: OverflowMenuProps) => (
<Box display="flex" justifyContent="flexEnd">
<Box className={styles.wrapperPositioning}>
<MenuRenderer
trigger={(triggerProps) => (
<ButtonIcon
// @ts-expect-error With no id, ButtonIcon will fallback from Tooltip to title internally.
// ID will no longer be required when React 18 has sufficient adoption and we can safely `useId()`
id={id}
icon={<IconOverflow />}
variant="transparent"
label={label}
{...triggerProps}
/>
)}
align="right"
offsetSpace="small"
{...menuProps}
>
{children}
</MenuRenderer>
</Box>
<Box
className={styles.wrapperPositioning}
display="flex"
justifyContent="flexEnd"
>
<MenuRenderer
trigger={(triggerProps) => (
<ButtonIcon
// @ts-expect-error With no id, ButtonIcon will fallback from Tooltip to title internally.
// ID will no longer be required when React 18 has sufficient adoption and we can safely `useId()`
id={id}
icon={<IconOverflow />}
variant="transparent"
label={label}
{...triggerProps}
/>
)}
align="right"
offsetSpace="small"
{...menuProps}
>
{children}
</MenuRenderer>
</Box>
);

0 comments on commit 02ae1fe

Please sign in to comment.