summaryrefslogtreecommitdiff
path: root/src/core/components/elements/Navbar/Search.jsx
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-08-08 10:39:34 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-08-08 10:39:34 +0700
commit16fed2e7d00252f5df3f9b5bdf0a5a2b2a094f76 (patch)
tree53d9f4d8991ba699b30eacfac1b2498ae1b0bf48 /src/core/components/elements/Navbar/Search.jsx
parentf862f6426c28fb9245d13fb7386a88b209639d64 (diff)
Improve home page performance
Diffstat (limited to 'src/core/components/elements/Navbar/Search.jsx')
-rw-r--r--src/core/components/elements/Navbar/Search.jsx30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/core/components/elements/Navbar/Search.jsx b/src/core/components/elements/Navbar/Search.jsx
index 47a9c235..f4a8ab3a 100644
--- a/src/core/components/elements/Navbar/Search.jsx
+++ b/src/core/components/elements/Navbar/Search.jsx
@@ -64,21 +64,21 @@ const Search = () => {
<MagnifyingGlassIcon className='w-6' />
</button>
- {suggestions.length > 0 && (
- <>
- <div className='absolute w-full top-[50px] rounded-b bg-gray_r-1 border border-gray_r-6 divide-y divide-gray_r-6 z-50'>
- {suggestions.map((suggestion, index) => (
- <Link
- href={`/shop/search?q=${suggestion.term}`}
- key={index}
- className='px-3 py-3 !text-gray_r-12 font-normal'
- >
- {suggestion.term}
- </Link>
- ))}
- </div>
- </>
- )}
+ <div
+ className={`absolute w-full top-[50px] rounded-b bg-gray_r-1 border border-gray_r-6 divide-y divide-gray_r-6 z-50 ${
+ suggestions.length > 0 ? 'block' : 'hidden'
+ }`}
+ >
+ {suggestions.map((suggestion, index) => (
+ <Link
+ href={`/shop/search?q=${suggestion.term}`}
+ key={index}
+ className='px-3 py-3 !text-gray_r-12 font-normal'
+ >
+ {suggestion.term}
+ </Link>
+ ))}
+ </div>
</form>
</>
)