Use cn() for class names throughout (#11278)

* add scrollbar on ptz presets dropdown

* use cn function for class names throughout

* Revert "add scrollbar on ptz presets dropdown"

This reverts commit 2cee93dc3e.
This commit is contained in:
Josh Hawkins
2024-05-07 08:00:25 -06:00
committed by GitHub
parent a0da5018bf
commit 08e5c791c8
18 changed files with 94 additions and 26 deletions
+6 -3
View File
@@ -8,6 +8,7 @@ import { isDesktop } from "react-device-detect";
import { TooltipPortal } from "@radix-ui/react-tooltip";
import { NavData } from "@/types/navigation";
import { IconType } from "react-icons";
import { cn } from "@/lib/utils";
const variants = {
primary: {
@@ -42,9 +43,11 @@ export default function NavItem({
to={item.url}
onClick={onClick}
className={({ isActive }) =>
`flex flex-col justify-center items-center rounded-lg ${className ?? ""} ${
variants[item.variant ?? "primary"][isActive ? "active" : "inactive"]
}`
cn(
"flex flex-col justify-center items-center rounded-lg",
className,
variants[item.variant ?? "primary"][isActive ? "active" : "inactive"],
)
}
>
<Icon className="size-5 md:m-[6px]" />