feat: app sidebar support collapse (#1997)

This commit is contained in:
zxhlyh
2024-01-11 13:26:34 +08:00
committed by GitHub
parent eed5fdd768
commit 1372bf784f
10 changed files with 193 additions and 11 deletions

View File

@@ -18,7 +18,7 @@ export type NavLinkProps = {
selected: NavIcon
normal: NavIcon
}
mode?: 'expand' | 'collapse'
mode?: string
}
export default function NavLink({
@@ -45,13 +45,15 @@ export default function NavLink({
href={href}
className={classNames(
isActive ? 'bg-primary-50 text-primary-600 font-semibold' : 'text-gray-700 hover:bg-gray-100 hover:text-gray-700',
'group flex items-center rounded-md px-2 py-2 text-sm font-normal',
'group flex items-center h-9 rounded-md py-2 text-sm font-normal',
mode === 'expand' ? 'px-3' : 'px-2.5',
)}
>
<NavIcon
className={classNames(
'mr-2 h-4 w-4 flex-shrink-0',
'h-4 w-4 flex-shrink-0',
isActive ? 'text-primary-600' : 'text-gray-700',
mode === 'expand' ? 'mr-2' : 'mr-0',
)}
aria-hidden="true"
/>