blob: 0bc9e9679a4d2cb10894d25e8efcef7a04f7b378 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
import {
ChevronDownIcon,
HeartIcon,
ShoppingCartIcon,
DocumentCheckIcon
} from '@heroicons/react/24/outline'
import Link from '../Link/Link'
import Image from 'next/image'
import DesktopView from '../../views/DesktopView'
import dynamic from 'next/dynamic'
import IndoteknikLogo from '@/images/logo.png'
import Category from '@/lib/category/components/Category'
import { useState } from 'react'
import useAuth from '@/core/hooks/useAuth'
import NavbarUserDropdown from './NavbarUserDropdown'
const Search = dynamic(() => import('./Search'))
const NavbarDesktop = () => {
const [isOpenCategory, setIsOpenCategory] = useState(false)
const auth = useAuth()
return (
<DesktopView>
<div className='py-3 bg-warning-400' id='desktop-nav-top'>
<div className='container mx-auto flex justify-between'>
<Link href='/' className='!text-gray_r-12'>
Tentang Indoteknik.com
</Link>
<div className='flex gap-x-6'>
<Link href='/' className='!text-gray_r-12'>
Pembayaran Tempo
</Link>
<Link href='/' className='!text-gray_r-12'>
F.A.Q
</Link>
<Link href='/' className='!text-gray_r-12'>
Fitur Layanan
</Link>
</div>
</div>
</div>
<nav className='py-6 sticky top-0 z-50 bg-white border-b border-gray_r-6'>
<div className='container mx-auto flex gap-x-6'>
<Link href='/'>
<Image src={IndoteknikLogo} alt='Indoteknik Logo' width={210} height={210 / 3} />
</Link>
<div className='flex-1 flex items-center'>
<Search />
</div>
<div className='flex gap-x-4'>
<Link href='/my/transactions' className='flex items-center gap-x-2 !text-gray_r-12/80'>
<DocumentCheckIcon className='w-7' />
Pending
<br />
Quotation
</Link>
<Link href='/shop/cart' className='flex items-center gap-x-2 !text-gray_r-12/80'>
<ShoppingCartIcon className='w-7' />
Keranjang
<br />
Belanja
</Link>
<Link href='/my/wishlist' className='flex items-center gap-x-2 !text-gray_r-12/80'>
<HeartIcon className='w-7' />
Wishlist
</Link>
<a
href='https://wa.me/628128080622'
target='_blank'
rel='noreferrer'
className='flex items-center gap-x-1 !text-gray_r-12/80'
>
<Image src='/images/socials/Whatsapp-2.png' alt='Whatsapp' width={48} height={48} />
<div>
<div className='font-semibold'>Whatsapp</div>
0812 8080 622 (Chat)
</div>
</a>
</div>
</div>
</nav>
<div className='container mx-auto mt-6'>
<div className='flex bg-gray_r-2'>
<button
type='button'
onClick={() => setIsOpenCategory((isOpen) => !isOpen)}
onBlur={() => setIsOpenCategory(false)}
className='w-3/12 p-4 font-semibold border border-gray_r-6 rounded-tl-xl flex items-center relative'
>
<div>Kategori Produk</div>
<ChevronDownIcon className={`ml-auto w-6 ${isOpenCategory ? 'rotate-180' : ''}`} />
<div className={`category-mega-box-wrapper ${isOpenCategory ? 'show' : ''}`}>
<Category />
</div>
</button>
<div className='w-6/12 flex gap-x-1 px-1 bg-gray_r-1'>
<Link
href='/shop/brands'
className='p-4 flex-1 flex justify-center items-center !text-gray_r-12/80 bg-gray_r-2 hover:bg-gray_r-4 border border-gray_r-6 idt-transition'
>
Semua Brand
</Link>
<Link
href='/shop/search?orderBy=stock'
className='p-4 flex-1 flex justify-center items-center !text-gray_r-12/80 bg-gray_r-2 hover:bg-gray_r-4 border border-gray_r-6 idt-transition'
>
Ready Stock
</Link>
<Link
href='/blog'
className='p-4 flex-1 flex justify-center items-center !text-gray_r-12/80 bg-gray_r-2 hover:bg-gray_r-4 border border-gray_r-6 idt-transition'
>
Blog Indoteknik
</Link>
<Link
href='/video'
className='p-4 flex-1 flex justify-center items-center !text-gray_r-12/80 bg-gray_r-2 hover:bg-gray_r-4 border border-gray_r-6 idt-transition'
>
Indoteknik TV
</Link>
</div>
<div className='w-3/12 flex gap-x-1 relative'>
{!auth && (
<>
<Link
href='/login'
className='flex-1 flex justify-center items-center bg-danger-500 !text-gray_r-1 rounded-none'
>
Masuk
</Link>
<Link
href='/register'
className='flex-1 flex justify-center items-center bg-danger-500 !text-gray_r-1 rounded-none rounded-tr-xl'
>
Daftar
</Link>
</>
)}
{auth && (
<>
<div href='/' className='navbar-user-dropdown-button'>
<span>Halo, {auth?.name}</span>
<div className='ml-auto'>
<ChevronDownIcon className='w-6' />
</div>
</div>
<NavbarUserDropdown />
</>
)}
</div>
</div>
</div>
</DesktopView>
)
}
export default NavbarDesktop
|