From a3d42d386bb4e270c84cbc66a8ab139b8e915a45 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Mon, 6 Mar 2023 16:58:14 +0700 Subject: create desktop header --- src/core/components/elements/Navbar/Search.jsx | 74 ++++++++++++++------------ 1 file changed, 39 insertions(+), 35 deletions(-) (limited to 'src/core/components/elements/Navbar/Search.jsx') diff --git a/src/core/components/elements/Navbar/Search.jsx b/src/core/components/elements/Navbar/Search.jsx index ff2c7adb..644e0c9f 100644 --- a/src/core/components/elements/Navbar/Search.jsx +++ b/src/core/components/elements/Navbar/Search.jsx @@ -3,6 +3,8 @@ import { MagnifyingGlassIcon } from '@heroicons/react/24/outline' import { useCallback, useEffect, useRef, useState } from 'react' import Link from '../Link/Link' import { useRouter } from 'next/router' +import MobileView from '../../views/MobileView' +import DesktopView from '../../views/DesktopView' const Search = () => { const router = useRouter() @@ -50,43 +52,45 @@ const Search = () => { } return ( -
- setQuery(e.target.value)} - onBlur={onInputBlur} - onFocus={loadSuggestion} - /> - + setQuery(e.target.value)} + onBlur={onInputBlur} + onFocus={loadSuggestion} + /> + - {suggestions.length > 1 && ( - <> -
- {suggestions.map((suggestion, index) => ( - - {suggestion.term} - - ))} -
- - )} -
+ {suggestions.length > 1 && ( + <> +
+ {suggestions.map((suggestion, index) => ( + + {suggestion.term} + + ))} +
+ + )} + + ) } -- cgit v1.2.3