diff --git a/frontends/nextjs/src/components/organisms/navigation/SidebarGroup.tsx b/frontends/nextjs/src/components/organisms/navigation/SidebarGroup.tsx index 40c0ea83c..e5ac06c6a 100644 --- a/frontends/nextjs/src/components/organisms/navigation/SidebarGroup.tsx +++ b/frontends/nextjs/src/components/organisms/navigation/SidebarGroup.tsx @@ -1,10 +1,12 @@ 'use client' -import { Box, Collapse, List, Typography } from '@mui/material' import { forwardRef, ReactNode, useState } from 'react' +import { Box, Collapse, List, Typography } from '@/fakemui' import { ExpandLess, ExpandMore } from '@/fakemui/icons' +import styles from './SidebarGroup.module.scss' + // SidebarGroup interface SidebarGroupProps { children: ReactNode @@ -15,27 +17,19 @@ interface SidebarGroupProps { } const SidebarGroup = forwardRef( - ({ children, label, collapsible, defaultOpen = true, ...props }, ref) => { + ({ children, label, collapsible, defaultOpen = true, className = '', ...props }, ref) => { const [open, setOpen] = useState(defaultOpen) return ( - + {label && ( setOpen(!open) : undefined} - sx={{ - display: 'flex', - alignItems: 'center', - justifyContent: 'space-between', - px: 2, - py: 1, - cursor: collapsible ? 'pointer' : 'default', - }} + className={`${styles.sidebarGroupHeader} ${collapsible ? styles.collapsible : ''}`} > {label} @@ -45,12 +39,12 @@ const SidebarGroup = forwardRef( )} {collapsible ? ( - + {children} ) : ( - + {children} )} @@ -62,13 +56,12 @@ SidebarGroup.displayName = 'SidebarGroup' // SidebarGroupLabel const SidebarGroupLabel = forwardRef( - ({ children, ...props }, ref) => { + ({ children, className = '', ...props }, ref) => { return ( {children} @@ -80,10 +73,10 @@ SidebarGroupLabel.displayName = 'SidebarGroupLabel' // SidebarGroupContent const SidebarGroupContent = forwardRef( - ({ children, ...props }, ref) => { + ({ children, className = '', ...props }, ref) => { return ( - - + + {children} diff --git a/frontends/nextjs/src/components/organisms/navigation/SidebarMenu.tsx b/frontends/nextjs/src/components/organisms/navigation/SidebarMenu.tsx index 20956447c..bd10a5454 100644 --- a/frontends/nextjs/src/components/organisms/navigation/SidebarMenu.tsx +++ b/frontends/nextjs/src/components/organisms/navigation/SidebarMenu.tsx @@ -1,14 +1,17 @@ 'use client' -import { Box, List, ListItem, ListItemButton, ListItemIcon, ListItemText } from '@mui/material' import { forwardRef, ReactNode } from 'react' +import { Box, List, ListItem, ListItemButton, ListItemIcon, ListItemText } from '@/fakemui' + +import styles from './SidebarMenu.module.scss' + // SidebarMenu (alias for List) const SidebarMenu = forwardRef( - ({ children, ...props }, ref) => { + ({ children, className = '', ...props }, ref) => { return ( - - + + {children} @@ -30,36 +33,39 @@ interface SidebarMenuItemProps { } const SidebarMenuItem = forwardRef( - ({ children, icon, label, href, active, disabled, onClick, ...props }, ref) => { + ({ children, icon, label, href, active, disabled, onClick, className = '', ...props }, ref) => { const content = children || label + const activeClass = active ? styles.active : '' + + const buttonContent = ( + <> + {icon && {icon}} + + + ) return ( - - - - {icon && {icon}} - - + + + {href ? ( + + {buttonContent} + + ) : ( + + {buttonContent} + + )} )