fix: dashboard sidebars are not uniform

This commit is contained in:
DIYgod 2023-07-25 20:46:05 +01:00
parent 0fde971a6d
commit a0953be830
No known key found for this signature in database
1 changed files with 17 additions and 6 deletions

View File

@ -241,13 +241,22 @@ export default function DashboardLayout({
`flex px-4 h-12 items-center rounded-md space-x-2 w-full transition-colors`,
active
? `bg-slate-200 font-medium text-accent`
: `hover:bg-slate-200 hover:bg-opacity-50`,
: link.href || link.onClick
? "hover:bg-slate-200 hover:bg-opacity-50"
: "opacity-80",
!true && "justify-center",
)}
onClick={link.onClick}
>
<span className={cn(link.icon, "text-xl")}></span>
<span>{t(link.text)}</span>
<i
className={cn(link.icon, "text-xl")}
style={{
marginLeft: link.lever
? (link.lever - 1) * 20
: 0,
}}
></i>
<span className="truncate">{t(link.text)}</span>
</UniLink>
</div>
)
@ -350,15 +359,17 @@ export default function DashboardLayout({
)}
onClick={link.onClick}
>
<span
<i
className={cn(link.icon, "text-xl")}
style={{
marginLeft: link.lever
? (link.lever - 1) * 20
: 0,
}}
></span>
{isOpen && <span>{t(link.text)}</span>}
></i>
{isOpen && (
<span className="truncate">{t(link.text)}</span>
)}
</UniLink>
)
})}