diff --git a/app/dashboard/src/components/Sidebar/index.tsx b/app/dashboard/src/components/Sidebar/index.tsx index 8148a0c..4f2ddff 100644 --- a/app/dashboard/src/components/Sidebar/index.tsx +++ b/app/dashboard/src/components/Sidebar/index.tsx @@ -24,32 +24,48 @@ export const SidebarMenuIcon = chakra(HamburgerIcon, { }); export const SidebarItem: FC = ({ itemIcon: ItemIcon, name, path, index, }) => { - const hoverStyle = { - borderRadius: 4, - border: '4px', - m: '-2px', - borderColor: 'primary.100', - }; - const activeStyle = { - bg: 'primary.500', - ...hoverStyle, - }; const { t } = useTranslation(); const { activePage, activatePage } = useDashboard(); const [active, activate] = useState(index === activePage) useEffect(() => { activate(index === activePage) }, [active, activePage]); + const darkStyle = { bg: active ? 'primary.900' : 'transparent' }; + const hoverStyle = { + borderRadius: 10, + bg: active ? undefined : 'gray.200', + _dark: { + bg: 'gray.700' + }, + transition: 'background-color 0.9s', + }; + return ( - { activatePage(index) }}> - - - + { + activatePage(index); + }} + > + + + - {t(name)} + + {t(name)} + - ) + ); } export const Sidebar = () => { @@ -59,13 +75,14 @@ export const Sidebar = () => { pos="sticky" left="5" borderRightWidth="4px" - borderRightColor="primary.100" + borderRightColor='gray.200' borderRightStyle="solid" flexDir="column" h="100vh" bg="gray.50" + _dark={{ bg: 'gray.800', borderRightColor: 'gray.700' }} > - + marzneshin {pages.map((item: SideBarItemProps, index: number) => )}