From cd27ff7dd5fe0c98017b5615e7c03bf6c1d76a49 Mon Sep 17 00:00:00 2001 From: Thomas Camlong Date: Thu, 17 Apr 2025 10:28:43 +0200 Subject: [PATCH] remove getIconVariant --- web/src/app/icons/components/icon-search.tsx | 23 ++------------------ 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/web/src/app/icons/components/icon-search.tsx b/web/src/app/icons/components/icon-search.tsx index 07b79be6..3065a2e0 100644 --- a/web/src/app/icons/components/icon-search.tsx +++ b/web/src/app/icons/components/icon-search.tsx @@ -257,23 +257,6 @@ export function IconSearch({ icons }: IconSearchProps) { } }, []) - // Helper function to get the appropriate icon variant based on theme - const getIconVariant = (name: string, data: Icon) => { - // Check if the icon has theme variants and use appropriate one - if (data.colors) { - // If in dark mode and a light variant exists, use the light variant - if (resolvedTheme === "dark" && data.colors.light) { - return data.colors.light - } - // If in light mode and a dark variant exists, use the dark variant - if (resolvedTheme === "light" && data.colors.dark) { - return data.colors.dark - } - } - // Fall back to the default name if no appropriate variant - return name - } - if (!searchParams) return null const getSortLabel = (sort: SortOption) => { @@ -507,7 +490,7 @@ export function IconSearch({ icons }: IconSearchProps) {
{filteredIcons.map(({ name, data }) => ( - + ))}
@@ -519,12 +502,10 @@ export function IconSearch({ icons }: IconSearchProps) { function IconCard({ name, data, - getIconVariant, matchedAlias, }: { name: string data: Icon - getIconVariant: (name: string, data: Icon) => string matchedAlias?: string | null }) { const ref = useRef(null) @@ -568,7 +549,7 @@ function IconCard({