From 74fcaab5e9aa9538bff31e01f669dd9811a64c26 Mon Sep 17 00:00:00 2001 From: H0llyW00dzZ Date: Wed, 11 Oct 2023 04:36:04 +0700 Subject: [PATCH] Refactor Mask UI Page [Masks] [+] refactor(mask.tsx): refactor simple search to be case-insensitive --- app/components/mask.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/components/mask.tsx b/app/components/mask.tsx index 1ee1c239a74..9fe1d485a6b 100644 --- a/app/components/mask.tsx +++ b/app/components/mask.tsx @@ -393,11 +393,13 @@ export function MaskPage() { const [searchText, setSearchText] = useState(""); const masks = searchText.length > 0 ? searchMasks : allMasks; - // simple search, will refactor later + // refactored already, now it accurate const onSearch = (text: string) => { setSearchText(text); if (text.length > 0) { - const result = allMasks.filter((m) => m.name.includes(text)); + const result = allMasks.filter((m) => + m.name.toLowerCase().includes(text.toLowerCase()) + ); setSearchMasks(result); } else { setSearchMasks(allMasks);