diff --git a/striker-ui/components/ButtonWithMenu.tsx b/striker-ui/components/ButtonWithMenu.tsx index 797eff73..42a7ebab 100644 --- a/striker-ui/components/ButtonWithMenu.tsx +++ b/striker-ui/components/ButtonWithMenu.tsx @@ -9,6 +9,8 @@ import Menu from './Menu'; const ButtonWithMenu: FC = (props) => { const { children, + containedButtonProps, + iconButtonProps, muiMenuProps, onButtonClick, onItemClick, @@ -38,16 +40,24 @@ const ButtonWithMenu: FC = (props) => { const buttonElement = useMemo(() => { if (variant === 'contained') { return ( - + {buttonContent} ); } return ( - {buttonContent} + + {buttonContent} + ); - }, [buttonClickHandler, buttonContent, variant]); + }, [ + buttonClickHandler, + buttonContent, + containedButtonProps, + iconButtonProps, + variant, + ]); const itemClickHandler = useCallback< Exclude diff --git a/striker-ui/components/ServerMenu.tsx b/striker-ui/components/ServerMenu.tsx index daa09bd8..7a1268cd 100644 --- a/striker-ui/components/ServerMenu.tsx +++ b/striker-ui/components/ServerMenu.tsx @@ -9,7 +9,18 @@ import { BodyText } from './Text'; import useConfirmDialog from '../hooks/useConfirmDialog'; const ServerMenu: FC = (props) => { - const { serverName, serverState, serverUuid } = props; + const { + // Props to ignore, for now: + getItemDisabled, + items, + onItemClick, + renderItem, + // ---------- + serverName, + serverState, + serverUuid, + ...buttonWithMenuProps + } = props; const { confirmDialog, @@ -119,6 +130,7 @@ const ServerMenu: FC = (props) => { ); }} + {...buttonWithMenuProps} /> {confirmDialog} diff --git a/striker-ui/pages/index.tsx b/striker-ui/pages/index.tsx index f6ca320e..dceb1c32 100644 --- a/striker-ui/pages/index.tsx +++ b/striker-ui/pages/index.tsx @@ -81,6 +81,7 @@ const createServerPreviewContainer = (servers: ServerListItem[]) => ( {anvilName} , = Omit, 'open'> & { + containedButtonProps?: Partial; + iconButtonProps?: Partial; onButtonClick?: import('react').MouseEventHandler; variant?: 'contained' | 'icon'; };