From be9943812303a7baba0d29768c9b3948a788243a Mon Sep 17 00:00:00 2001 From: Sergio <77530549+sergi0g@users.noreply.github.com> Date: Fri, 21 Mar 2025 18:17:05 +0200 Subject: [PATCH] refactor: search component --- web/src/App.tsx | 5 +++- web/src/components/Search.tsx | 46 +++++++++++++++++------------------ web/tailwind.config.js | 12 ++------- 3 files changed, 28 insertions(+), 35 deletions(-) diff --git a/web/src/App.tsx b/web/src/App.tsx index fa67e25..34e563f 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -24,6 +24,7 @@ const SORT_ORDER = [ function App() { const [data, setData] = useState(null); const [searchQuery, setSearchQuery] = useState(""); + if (!data) return ; return (
- +
+ +
    {Object.entries( data.images.reduce>( diff --git a/web/src/components/Search.tsx b/web/src/components/Search.tsx index 5fadd78..c7bf5e2 100644 --- a/web/src/components/Search.tsx +++ b/web/src/components/Search.tsx @@ -23,32 +23,30 @@ export default function Search({ onChange(""); }; return ( -
    -
    - -
    - -
    - {showClear && ( - - )} +
    + +
    +
    + {showClear && ( + + )}
    diff --git a/web/tailwind.config.js b/web/tailwind.config.js index 4474f32..dc3afbe 100644 --- a/web/tailwind.config.js +++ b/web/tailwind.config.js @@ -32,19 +32,11 @@ export default { }, { pattern: /text-(gray|neutral)-600/, - variants: ["dark", "hover"], + variants: ["*", "dark", "hover", "placeholder"], }, { pattern: /text-(gray|neutral)-400/, - variants: ["dark", "dark:hover"], - }, - { - pattern: /text-(gray|neutral)-600/, - variants: ["placeholder"], - }, - { - pattern: /text-(gray|neutral)-400/, - variants: ["placeholder:dark"], + variants: ["*:dark", "dark", "dark:hover", "placeholder:dark"], }, { pattern: /text-(gray|neutral)-700/,