From 8d658855acff0ba5dcb36505bd50d675acb18b20 Mon Sep 17 00:00:00 2001 From: rusconn Date: Sat, 24 Jun 2023 18:26:26 +0900 Subject: [PATCH] refactor: only a small tweak --- components/sidebar/tool-groups.tsx | 4 +--- lib/style.ts | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/components/sidebar/tool-groups.tsx b/components/sidebar/tool-groups.tsx index 64be1dc..3f96f16 100644 --- a/components/sidebar/tool-groups.tsx +++ b/components/sidebar/tool-groups.tsx @@ -9,9 +9,7 @@ import { toolGroups } from "@/config/tools"; import { ToolGroup } from "./tool-group"; const isGroupedTool = (path: string) => - Object.values(toolGroups) - .map(({ href }) => href as string) - .some(group => path.startsWith(`${group}/`)); + Object.values(toolGroups).some(({ href }) => path.startsWith(`${href}/`)); export function ToolGroups() { const pathname = usePathname(); diff --git a/lib/style.ts b/lib/style.ts index a5ef193..a500a73 100644 --- a/lib/style.ts +++ b/lib/style.ts @@ -1,6 +1,4 @@ import { clsx, type ClassValue } from "clsx"; import { twMerge } from "tailwind-merge"; -export function cn(...inputs: ClassValue[]) { - return twMerge(clsx(inputs)); -} +export const cn = (...inputs: ClassValue[]) => twMerge(clsx(inputs));