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/Navbar.jsx | 171 +++++++++++++++++++++---- src/core/components/elements/Navbar/Search.jsx | 74 ++++++----- 2 files changed, 185 insertions(+), 60 deletions(-) (limited to 'src/core/components/elements') diff --git a/src/core/components/elements/Navbar/Navbar.jsx b/src/core/components/elements/Navbar/Navbar.jsx index 8cecee5b..0198ea5e 100644 --- a/src/core/components/elements/Navbar/Navbar.jsx +++ b/src/core/components/elements/Navbar/Navbar.jsx @@ -1,9 +1,17 @@ import dynamic from 'next/dynamic' import Image from 'next/image' import IndoteknikLogo from '@/images/logo.png' -import { Bars3Icon, HeartIcon, ShoppingCartIcon } from '@heroicons/react/24/outline' +import { + Bars3Icon, + DocumentCheckIcon, + HeartIcon, + ShoppingCartIcon +} from '@heroicons/react/24/outline' import Link from '../Link/Link' import useSidebar from '@/core/hooks/useSidebar' +import MobileView from '../../views/MobileView' +import DesktopView from '../../views/DesktopView' +import DocumentTimeIcon from '@/icons/document_time.svg' const Search = dynamic(() => import('./Search')) @@ -11,34 +19,147 @@ const Navbar = () => { const { Sidebar, open } = useSidebar() return ( <> - + {Sidebar} + + + +
+
+ - - + Tentang Indoteknik.com + +
+ + Pembayaran Tempo + + + F.A.Q + + + Fitur Layanan + +
+
+
+ + + +
+
+
+ Kategori Produk +
+
+ + Promo Produk + + + Semua Brand + + + Ready Stock + + + Blog Indoteknik + +
- - - {Sidebar} +
) } 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