diff --git a/src/app/(main)/SideNav.tsx b/src/app/(main)/SideNav.tsx index 9d9c72bd9..f91ccc08e 100644 --- a/src/app/(main)/SideNav.tsx +++ b/src/app/(main)/SideNav.tsx @@ -85,7 +85,7 @@ export function SideNav(props: any) { - + {links.map(({ id, path, label, icon }) => { diff --git a/src/components/common/Sidebar.tsx b/src/components/common/Sidebar.tsx deleted file mode 100644 index 7c232b423..000000000 --- a/src/components/common/Sidebar.tsx +++ /dev/null @@ -1,122 +0,0 @@ -import { - Box, - Column, - type ColumnProps, - Focusable, - Icon, - Row, - type RowProps, - Text, - Tooltip, - TooltipTrigger, -} from '@umami/react-zen'; -import classNames from 'classnames'; -import { createContext, type ReactNode, useContext } from 'react'; - -export interface SidebarProps extends ColumnProps { - isCollapsed?: boolean; - muteItems?: boolean; - children?: ReactNode; -} - -const SidebarContext = createContext(null as any); - -export function Sidebar({ isCollapsed, muteItems, className, children, ...props }: SidebarProps) { - return ( - - - {children} - - - ); -} - -export function SidebarSection({ - title, - className, - children, - ...props -}: { title?: string; children: ReactNode } & ColumnProps) { - return ( - - {title && ( - - - {title} - - - )} - {children} - - ); -} - -export function SidebarHeader({ - label, - icon, - className, - children, - ...props -}: { - label: string; - icon?: ReactNode; - children?: ReactNode; -} & RowProps) { - return ( - - {icon && {icon}} - {label && {label}} - {children} - - ); -} - -export interface SidebarItemProps extends RowProps { - isSelected?: boolean; -} - -export function SidebarItem({ - label, - icon, - isSelected, - className, - children, - ...props -}: { - label?: string; - icon?: ReactNode; -} & SidebarItemProps) { - const { isCollapsed } = useContext(SidebarContext); - - return ( - - - - {icon && {icon}} - {label && !isCollapsed && {label}} - {children} - - - {label} - - ); -}