From e04726f9d9082ceb50ca76cce6886c41d19148b5 Mon Sep 17 00:00:00 2001 From: Charles de Dreuille Date: Fri, 12 Jan 2024 16:20:29 +0000 Subject: [PATCH] Update Menu.tsx --- .../manager/src/components/sidebar/Menu.tsx | 38 +------------------ 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/code/ui/manager/src/components/sidebar/Menu.tsx b/code/ui/manager/src/components/sidebar/Menu.tsx index 9dadfa2b156e..bca52dd348ad 100644 --- a/code/ui/manager/src/components/sidebar/Menu.tsx +++ b/code/ui/manager/src/components/sidebar/Menu.tsx @@ -4,24 +4,12 @@ import React, { useMemo, useState } from 'react'; import { styled } from '@storybook/theming'; import { transparentize } from 'polished'; import type { Button, TooltipLinkListLink } from '@storybook/components'; -import { WithTooltip, TooltipLinkList, Icons, IconButton } from '@storybook/components'; +import { WithTooltip, TooltipLinkList, IconButton } from '@storybook/components'; import { CloseIcon, CogIcon } from '@storybook/icons'; import { useLayout } from '../layout/LayoutProvider'; export type MenuList = ComponentProps['links']; -const sharedStyles = { - height: 10, - width: 10, - marginLeft: -5, - marginRight: -5, - display: 'block', -}; - -const Icon = styled(Icons)(sharedStyles, ({ theme }) => ({ - color: theme.color.secondary, -})); - export const SidebarIconButton: FC & { highlighted: boolean }> = styled(IconButton)< ComponentProps & { @@ -64,28 +52,6 @@ const MenuButtonGroup = styled.div({ gap: 4, }); -const Img = styled.img(sharedStyles); -const Placeholder = styled.div(sharedStyles); - -export interface ListItemIconProps { - icon?: ComponentProps['icon']; - imgSrc?: string; -} - -/** - * @deprecated Please use `Icons` from `@storybook/components` instead - * Component will be removed in SB 8.0 - */ -export const MenuItemIcon = ({ icon, imgSrc }: ListItemIconProps) => { - if (icon) { - return ; - } - if (imgSrc) { - return image; - } - return ; -}; - type ClickHandler = TooltipLinkListLink['onClick']; const SidebarMenuList: FC<{ @@ -102,7 +68,7 @@ const SidebarMenuList: FC<{ onHide(); }) as ClickHandler, })); - }, [menu]); + }, [menu, onHide]); return ; };