From 4cf1007a78d50bec22d162d2d96d95f5b422e1ed Mon Sep 17 00:00:00 2001 From: Dante Soares Date: Fri, 19 Jan 2024 16:50:46 -0600 Subject: [PATCH] Probably don't need to export the type for the menu props --- src/components/DropdownMenu.tsx | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/components/DropdownMenu.tsx b/src/components/DropdownMenu.tsx index 4028a8301..dddc9b738 100644 --- a/src/components/DropdownMenu.tsx +++ b/src/components/DropdownMenu.tsx @@ -174,22 +174,20 @@ const DropdownMenuItemContainer = ({ ; }; -export type DropdownMenuProps = { - disabled?: boolean; - id: string; - text: string; - variant: ButtonVariant; - width?: string; -}; - export const DropdownMenu = ({ + children, disabled, id, text, variant, - children, width, -}: React.PropsWithChildren) => { +}: React.PropsWithChildren<{ + disabled?: boolean; + id: string; + text: string; + variant: ButtonVariant; + width?: string; +}>) => { const ref = React.useRef(null); const state = useDropdownMenu({ disabled }); @@ -225,17 +223,13 @@ export const DropdownMenu = ({ ; }; -export type DropdownMenuItemButtonProps = React.PropsWithChildren>; - const firstSibling = (element: Element) => element.parentElement?.firstElementChild; const lastSibling = (element: Element) => element.parentElement?.lastElementChild; const nextWithWraparound = (element: Element) => element.nextElementSibling ?? firstSibling(element); const previousWithWraparound = (element: Element) => element.previousElementSibling ?? lastSibling(element); export const DropdownMenuItemButton = ({ - children, - onClick, - ...buttonProps + children, onClick, ...buttonProps }: React.PropsWithChildren>) => { const { closeMenu } = React.useContext(DropdownMenuContext);