@luxfi/core 5.2.4 → 5.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/commerce/desktop-nav-menu.tsx +235 -0
- package/components/commerce/mobile-login-button.tsx +3 -2
- package/components/commerce/mobile-nav-menu-ai.tsx +30 -83
- package/components/commerce/mobile-nav-menu-item.tsx +13 -9
- package/components/commerce/mobile-nav-menu.tsx +34 -46
- package/components/header/desktop.tsx +5 -2
- package/components/header/index.tsx +29 -17
- package/components/header/mobile.tsx +1 -0
- package/components/icons/social-icon.tsx +1 -1
- package/components/icons/warpcast.tsx +58 -0
- package/package.json +1 -1
- package/site-def/main-nav.tsx +205 -159
@@ -0,0 +1,235 @@
|
|
1
|
+
"use client"
|
2
|
+
|
3
|
+
import * as React from "react"
|
4
|
+
|
5
|
+
import Link from "next/link"
|
6
|
+
import { cn } from '@hanzo/ui/util'
|
7
|
+
import type { LinkDef } from '@hanzo/ui/types'
|
8
|
+
import type { LinkDefExtended } from "../../site-def/main-nav"
|
9
|
+
import {
|
10
|
+
NavigationMenu,
|
11
|
+
NavigationMenuContent,
|
12
|
+
NavigationMenuItem,
|
13
|
+
NavigationMenuLink,
|
14
|
+
NavigationMenuList,
|
15
|
+
NavigationMenuTrigger,
|
16
|
+
navigationMenuTriggerStyle
|
17
|
+
} from '@hanzo/ui/primitives'
|
18
|
+
import Warpcast from "../icons/warpcast"
|
19
|
+
|
20
|
+
// const components: { title: string; href: string; description: string }[] = [
|
21
|
+
// {
|
22
|
+
// title: "Alert Dialog",
|
23
|
+
// href: "/docs/primitives/alert-dialog",
|
24
|
+
// description:
|
25
|
+
// "A modal dialog that interrupts the user with important content and expects a response.",
|
26
|
+
// },
|
27
|
+
// {
|
28
|
+
// title: "Hover Card",
|
29
|
+
// href: "/docs/primitives/hover-card",
|
30
|
+
// description:
|
31
|
+
// "For sighted users to preview content available behind a link.",
|
32
|
+
// },
|
33
|
+
// {
|
34
|
+
// title: "Progress",
|
35
|
+
// href: "/docs/primitives/progress",
|
36
|
+
// description:
|
37
|
+
// "Displays an indicator showing the completion progress of a task, typically displayed as a progress bar.",
|
38
|
+
// },
|
39
|
+
// {
|
40
|
+
// title: "Scroll-area",
|
41
|
+
// href: "/docs/primitives/scroll-area",
|
42
|
+
// description: "Visually or semantically separates content.",
|
43
|
+
// },
|
44
|
+
// {
|
45
|
+
// title: "Tabs",
|
46
|
+
// href: "/docs/primitives/tabs",
|
47
|
+
// description:
|
48
|
+
// "A set of layered sections of content—known as tab panels—that are displayed one at a time.",
|
49
|
+
// },
|
50
|
+
// {
|
51
|
+
// title: "Tooltip",
|
52
|
+
// href: "/docs/primitives/tooltip",
|
53
|
+
// description:
|
54
|
+
// "A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.",
|
55
|
+
// },
|
56
|
+
// ]
|
57
|
+
|
58
|
+
// export function NavigationMenuDemo() {
|
59
|
+
// return (
|
60
|
+
// <NavigationMenu>
|
61
|
+
// <NavigationMenuList>
|
62
|
+
// <NavigationMenuItem>
|
63
|
+
// <NavigationMenuTrigger>Getting started</NavigationMenuTrigger>
|
64
|
+
// <NavigationMenuContent>
|
65
|
+
// <ul className="grid gap-3 p-6 md:w-[400px] lg:w-[500px] lg:grid-cols-[.75fr_1fr]">
|
66
|
+
// <li className="row-span-3">
|
67
|
+
// <NavigationMenuLink asChild>
|
68
|
+
// <a
|
69
|
+
// className="flex h-full w-full select-none flex-col justify-end rounded-md bg-gradient-to-b from-muted/50 to-muted p-6 no-underline outline-none focus:shadow-md"
|
70
|
+
// href="/"
|
71
|
+
// >
|
72
|
+
// {/* <Icons.logo className="h-6 w-6" /> */}
|
73
|
+
// <div className="mb-2 mt-4 text-lg font-medium">
|
74
|
+
// shadcn/ui
|
75
|
+
// </div>
|
76
|
+
// <p className="text-sm leading-tight text-muted-foreground">
|
77
|
+
// Beautifully designed components that you can copy and
|
78
|
+
// paste into your apps. Accessible. Customizable. Open
|
79
|
+
// Source.
|
80
|
+
// </p>
|
81
|
+
// </a>
|
82
|
+
// </NavigationMenuLink>
|
83
|
+
// </li>
|
84
|
+
// <ListItem href="/docs" title="Introduction">
|
85
|
+
// Re-usable components built using Radix UI and Tailwind CSS.
|
86
|
+
// </ListItem>
|
87
|
+
// <ListItem href="/docs/installation" title="Installation">
|
88
|
+
// How to install dependencies and structure your app.
|
89
|
+
// </ListItem>
|
90
|
+
// <ListItem href="/docs/primitives/typography" title="Typography">
|
91
|
+
// Styles for headings, paragraphs, lists...etc
|
92
|
+
// </ListItem>
|
93
|
+
// </ul>
|
94
|
+
// </NavigationMenuContent>
|
95
|
+
// </NavigationMenuItem>
|
96
|
+
// <NavigationMenuItem>
|
97
|
+
// <NavigationMenuTrigger>Components</NavigationMenuTrigger>
|
98
|
+
// <NavigationMenuContent>
|
99
|
+
// <ul className="w-[400px] gap-3 p-4 md:w-[500px] md:grid-cols-1 lg:w-[600px] ">
|
100
|
+
// {components.map((component) => (
|
101
|
+
// <ListItem
|
102
|
+
// key={component.title}
|
103
|
+
// title={component.title}
|
104
|
+
// href={component.href}
|
105
|
+
// >
|
106
|
+
// {component.description}
|
107
|
+
// </ListItem>
|
108
|
+
// ))}
|
109
|
+
// </ul>
|
110
|
+
// </NavigationMenuContent>
|
111
|
+
// </NavigationMenuItem>
|
112
|
+
// <NavigationMenuItem>
|
113
|
+
// <Link href="/docs" legacyBehavior passHref>
|
114
|
+
// <NavigationMenuLink className={navigationMenuTriggerStyle()}>
|
115
|
+
// Documentation
|
116
|
+
// </NavigationMenuLink>
|
117
|
+
// </Link>
|
118
|
+
// </NavigationMenuItem>
|
119
|
+
// </NavigationMenuList>
|
120
|
+
// </NavigationMenu>
|
121
|
+
// )
|
122
|
+
// }
|
123
|
+
|
124
|
+
|
125
|
+
const DesktopNav: React.FC<{
|
126
|
+
links: LinkDefExtended[],
|
127
|
+
}> = ({
|
128
|
+
links
|
129
|
+
|
130
|
+
}) => (
|
131
|
+
links.length > 0 ? (
|
132
|
+
<NavigationMenu>
|
133
|
+
<NavigationMenuList>
|
134
|
+
{links.map((el, index) => {
|
135
|
+
|
136
|
+
if (el.isAIMenu) {
|
137
|
+
return (
|
138
|
+
<NavigationMenuItem>
|
139
|
+
<Link href={el.href} legacyBehavior passHref>
|
140
|
+
<NavigationMenuLink className={navigationMenuTriggerStyle()}>
|
141
|
+
{el.title}
|
142
|
+
</NavigationMenuLink>
|
143
|
+
</Link>
|
144
|
+
</NavigationMenuItem>
|
145
|
+
)
|
146
|
+
} else if (el.title == 'Community') {
|
147
|
+
return (
|
148
|
+
<NavigationMenuItem>
|
149
|
+
<NavigationMenuTrigger>{el.title}</NavigationMenuTrigger>
|
150
|
+
<NavigationMenuContent>
|
151
|
+
<ul className="grid md:grid-cols-2 gap-3 p-6 md:w-[400px] lg:w-[500px]">
|
152
|
+
<li className="row-span-3">
|
153
|
+
<NavigationMenuLink asChild>
|
154
|
+
<a
|
155
|
+
className="flex h-full w-full select-none flex-col justify-end rounded-md bg-gradient-to-b from-muted/50 to-muted p-6 no-underline outline-none focus:shadow-md"
|
156
|
+
href={el.href}
|
157
|
+
>
|
158
|
+
<Warpcast />
|
159
|
+
<div className="mb-2 mt-4 text-lg font-medium">
|
160
|
+
{el.title}
|
161
|
+
</div>
|
162
|
+
<p className="text-sm leading-tight text-muted-foreground">
|
163
|
+
{el.details}
|
164
|
+
</p>
|
165
|
+
</a>
|
166
|
+
</NavigationMenuLink>
|
167
|
+
</li>
|
168
|
+
{el.childMenu?.map((component) => (
|
169
|
+
<div className="relative flex items-center my-2">
|
170
|
+
<div className="mr-2 mt-0">
|
171
|
+
{component.icon}
|
172
|
+
</div>
|
173
|
+
<ListItem href={component.href} title={component.title}>
|
174
|
+
{component.contents}
|
175
|
+
</ListItem>
|
176
|
+
</div>
|
177
|
+
))}
|
178
|
+
|
179
|
+
</ul>
|
180
|
+
</NavigationMenuContent>
|
181
|
+
</NavigationMenuItem>
|
182
|
+
)
|
183
|
+
} else {
|
184
|
+
return (
|
185
|
+
<NavigationMenuItem>
|
186
|
+
<NavigationMenuTrigger>{el.title}</NavigationMenuTrigger>
|
187
|
+
<NavigationMenuContent>
|
188
|
+
<ul className="grid w-[400px] gap-3 p-4 md:w-[500px] md:grid-cols-2 lg:w-[500px] ">
|
189
|
+
{el.childMenu?.map((component) => (
|
190
|
+
<ListItem
|
191
|
+
key={component.title}
|
192
|
+
title={component.title}
|
193
|
+
href={component.href}
|
194
|
+
>
|
195
|
+
{component.contents}
|
196
|
+
</ListItem>
|
197
|
+
))}
|
198
|
+
</ul>
|
199
|
+
</NavigationMenuContent>
|
200
|
+
</NavigationMenuItem>
|
201
|
+
)
|
202
|
+
}
|
203
|
+
|
204
|
+
})}
|
205
|
+
</NavigationMenuList>
|
206
|
+
</NavigationMenu>
|
207
|
+
) : null
|
208
|
+
)
|
209
|
+
export default DesktopNav
|
210
|
+
|
211
|
+
const ListItem = React.forwardRef<
|
212
|
+
React.ElementRef<"a">,
|
213
|
+
React.ComponentPropsWithoutRef<"a">
|
214
|
+
>(({ className, title, children, ...props }, ref) => {
|
215
|
+
return (
|
216
|
+
<li>
|
217
|
+
<NavigationMenuLink asChild>
|
218
|
+
<a
|
219
|
+
ref={ref}
|
220
|
+
className={cn(
|
221
|
+
"block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-level-1 hover:text-accent-foreground focus:bg-level-1 focus:text-accent-foreground",
|
222
|
+
className
|
223
|
+
)}
|
224
|
+
{...props}
|
225
|
+
>
|
226
|
+
<div className="text-sm font-medium leading-none">{title}</div>
|
227
|
+
<p className="line-clamp-3 text-sm leading-snug text-muted-foreground">
|
228
|
+
{children}
|
229
|
+
</p>
|
230
|
+
</a>
|
231
|
+
</NavigationMenuLink>
|
232
|
+
</li>
|
233
|
+
)
|
234
|
+
})
|
235
|
+
ListItem.displayName = "ListItem"
|
@@ -16,7 +16,6 @@ import { cn } from '@hanzo/ui/util'
|
|
16
16
|
|
17
17
|
import { useAuth } from "@hanzo/auth/service"
|
18
18
|
|
19
|
-
import { Avatar } from "../icons"
|
20
19
|
import { Ethereum } from "@hanzo/auth/icons"
|
21
20
|
import { Icons } from ".."
|
22
21
|
|
@@ -26,10 +25,12 @@ const MobileAuthWidget: React.FC<{
|
|
26
25
|
handleLogin?: () => void
|
27
26
|
}> = observer(({
|
28
27
|
noLogin = false,
|
29
|
-
handleLogin,
|
30
28
|
className
|
31
29
|
}) => {
|
32
30
|
const auth = useAuth()
|
31
|
+
const handleLogin = () => {
|
32
|
+
window.location.href = "https://lux.id";
|
33
|
+
};
|
33
34
|
|
34
35
|
if (!auth) {
|
35
36
|
return null
|
@@ -1,98 +1,45 @@
|
|
1
1
|
'use client'
|
2
2
|
import React, { useState } from 'react'
|
3
|
-
import
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import {
|
7
|
-
import
|
8
|
-
import Link from 'next/link'
|
3
|
+
import { Plus } from 'lucide-react'
|
4
|
+
import { Search } from '../icons'
|
5
|
+
import { ChatWidget } from '../../components'
|
6
|
+
import { Button, Card } from '@hanzo/ui/primitives'
|
7
|
+
import LuxLogo from '../icons/lux-logo'
|
9
8
|
|
10
9
|
interface MobileNavMenuAIProps {
|
11
|
-
|
12
|
-
setChatbotOpen: (open: boolean) => void
|
10
|
+
setMenuOpen: (open: boolean) => void
|
13
11
|
}
|
14
12
|
|
15
|
-
const MobileNavMenuAI: React.FC<MobileNavMenuAIProps> = ({
|
16
|
-
link,
|
17
|
-
setChatbotOpen
|
18
|
-
}) => {
|
13
|
+
const MobileNavMenuAI: React.FC<MobileNavMenuAIProps> = ({ setMenuOpen }) => {
|
19
14
|
const [isOpen, setIsOpen] = useState<boolean>(false)
|
20
15
|
|
21
|
-
React.useEffect(() => {
|
22
|
-
console.log('open', setChatbotOpen)
|
23
|
-
}, [setChatbotOpen]);
|
24
|
-
|
25
16
|
return (
|
26
17
|
<>
|
27
|
-
<
|
28
|
-
<div className="
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
console.log('test2')
|
33
|
-
}
|
34
|
-
}}>
|
35
|
-
<div className="flex items-center gap-5 border-b border-[#3A3A3A]">
|
36
|
-
<Search className='w-6 h-6 flex-none' />
|
37
|
-
<div className="text-white font-bold flex-1 ">Ask AI Chat...</div>
|
38
|
-
<RightArrow className='w-6 h-6 flex-none' />
|
39
|
-
</div>
|
40
|
-
</div>
|
41
|
-
</Link>
|
42
|
-
<div className={`fixed left-0 top-0 w-screen h-[calc(100vh-64px)] ${isOpen ? 'block' : 'hidden'}`} style={{ backgroundColor: 'black' }}>
|
43
|
-
<div className="h-fit bg-[#202020]">
|
44
|
-
<Command className='rounded-lg border shadow-md text-[#A7A7A8]'>
|
45
|
-
<div className="w-full px-5 py-4 text-2xl cursor-pointer">
|
46
|
-
<div className="flex items-center gap-5 border-b border-[#3A3A3A]">
|
47
|
-
<LeftArrow className='w-6 h-6' onClick={() => setIsOpen(false)} />
|
48
|
-
{/* <Search className='w-6 h-6 flex-none' />
|
49
|
-
<div className="text-white font-bold flex-1 ">Ask AI Chat...</div> */}
|
50
|
-
<CommandInput className="text-white font-bold flex-1 text-xl" placeholder='Ask AI Chat...' />
|
51
|
-
<RightArrow className='w-6 h-6 flex-none' />
|
52
|
-
</div>
|
53
|
-
</div>
|
54
|
-
<CommandList className='max-h-none h-fit'>
|
55
|
-
<CommandEmpty>No result found.</CommandEmpty>
|
56
|
-
<CommandGroup heading="Suggestions">
|
57
|
-
<CommandItem>
|
58
|
-
<Calendar className='mr-2 h-4 w-4' />
|
59
|
-
<span>Calendar</span>
|
60
|
-
</CommandItem>
|
61
|
-
<CommandItem>
|
62
|
-
<Smile className='mr-2 h-4 w-4' />
|
63
|
-
<span>Search Emoji</span>
|
64
|
-
</CommandItem>
|
65
|
-
<CommandItem>
|
66
|
-
<Calculator className="mr-2 h-4 w-4" />
|
67
|
-
<span>Calculator</span>
|
68
|
-
</CommandItem>
|
69
|
-
</CommandGroup>
|
70
|
-
<CommandSeparator>
|
71
|
-
</CommandSeparator>
|
72
|
-
<CommandGroup heading='Settings'>
|
73
|
-
<CommandItem>
|
74
|
-
<User className='mr-2 h-4 w-4' />
|
75
|
-
<span>Profile</span>
|
76
|
-
<CommandShortcut>⌘P</CommandShortcut>
|
77
|
-
</CommandItem>
|
78
|
-
<CommandItem>
|
79
|
-
<CreditCard className="mr-2 h-4 w-4" />
|
80
|
-
<span>Billing</span>
|
81
|
-
<CommandShortcut>⌘B</CommandShortcut>
|
82
|
-
</CommandItem>
|
83
|
-
<CommandItem>
|
84
|
-
<Settings className="mr-2 h-4 w-4" />
|
85
|
-
<span>Settings</span>
|
86
|
-
<CommandShortcut>⌘S</CommandShortcut>
|
87
|
-
</CommandItem>
|
88
|
-
</CommandGroup>
|
89
|
-
</CommandList>
|
90
|
-
</Command>
|
91
|
-
|
18
|
+
<div className="w-full px-5 py-4 text-2xl bg-[#202020] cursor-pointer">
|
19
|
+
<div className="flex items-center gap-5 border-b border-[#3A3A3A]">
|
20
|
+
<Search className='w-6 h-6 flex-none' />
|
21
|
+
<div className="text-white font-bold flex-1" onClick={() => setIsOpen(true)}>Ask AI Chat...</div>
|
22
|
+
<Plus className='w-6 h-6 flex-none rotate-45 transition-transform' onClick={() => setMenuOpen(false)} />
|
92
23
|
</div>
|
93
24
|
</div>
|
25
|
+
<div className={
|
26
|
+
'fixed bottom-0 sm:bottom-16 right-0 w-full h-full ' +
|
27
|
+
'sm:max-w-[400px] sm:max-h-[550px] sm:px-4 z-floating ' +
|
28
|
+
(isOpen ? 'flex' : 'hidden')
|
29
|
+
}>
|
30
|
+
<Card className='flex flex-col h-full w-full'>
|
31
|
+
<div className='flex px-4 py-2 h-16 bg-level-0 items-center justify-between'>
|
32
|
+
<h3 className='font-semibold font-heading'>LUX<span className='opacity-60'>AI</span></h3>
|
33
|
+
<Button onClick={() => setIsOpen(false)} variant='link' size='icon' className='w-fit sm:hidden'>
|
34
|
+
<Plus className='w-6 h-6 flex-none mr-1 rotate-45 transition-transform'/>
|
35
|
+
</Button>
|
36
|
+
</div>
|
37
|
+
<iframe src="https://lux.chat/iframe" className='h-full' />
|
38
|
+
</Card>
|
39
|
+
</div>
|
40
|
+
|
94
41
|
</>
|
95
42
|
)
|
96
|
-
}
|
43
|
+
};
|
97
44
|
|
98
|
-
export default MobileNavMenuAI
|
45
|
+
export default MobileNavMenuAI;
|
@@ -3,13 +3,17 @@ import type { LinkDefExtended } from '../../site-def/main-nav'
|
|
3
3
|
import { RightArrow } from '../icons'
|
4
4
|
import LeftArrow from '../icons/left-arrow'
|
5
5
|
import Link from 'next/link'
|
6
|
+
import MobileNavMenuAI from './mobile-nav-menu-ai'
|
6
7
|
|
7
8
|
interface MobileNavMenuItemProps {
|
8
|
-
link: LinkDefExtended
|
9
|
+
link: LinkDefExtended,
|
10
|
+
setMenuOpen: (open: boolean) => void
|
11
|
+
|
9
12
|
}
|
10
13
|
|
11
14
|
const MobileNavMenuItem: React.FC<MobileNavMenuItemProps> = ({
|
12
|
-
link
|
15
|
+
link,
|
16
|
+
setMenuOpen
|
13
17
|
}) => {
|
14
18
|
const [isOpen, setIsOpen] = useState<boolean>(false);
|
15
19
|
|
@@ -21,6 +25,7 @@ const MobileNavMenuItem: React.FC<MobileNavMenuItemProps> = ({
|
|
21
25
|
<RightArrow className='' />
|
22
26
|
</div>
|
23
27
|
<div className={`fixed left-0 top-0 w-screen h-screen ${isOpen ? 'block' : 'hidden'}`} style={{ backgroundColor: 'black' }}>
|
28
|
+
<MobileNavMenuAI setMenuOpen={setMenuOpen} />
|
24
29
|
<div className="w-full flex items-center px-5 py-3 gap-[27px] text-2xl font-bold" onClick={() => setIsOpen(false)}>
|
25
30
|
<LeftArrow />
|
26
31
|
<span className="text-white">{link.title}</span>
|
@@ -28,13 +33,12 @@ const MobileNavMenuItem: React.FC<MobileNavMenuItemProps> = ({
|
|
28
33
|
<div className="flex flex-col">
|
29
34
|
{link.childMenu?.map((menu, index) => {
|
30
35
|
return (
|
31
|
-
<
|
32
|
-
<
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
</div>
|
36
|
+
<Link href={menu.href}>
|
37
|
+
<div className="w-full flex items-center px-5 py-3 gap-[27px] text-2xl" key={index}>
|
38
|
+
<span className='w-[18px] h-[22px] self-center flex items-center justify-center'>{menu.icon}</span>
|
39
|
+
<span className='flex-1'>{menu.title}</span>
|
40
|
+
</div>
|
41
|
+
</Link>
|
38
42
|
)
|
39
43
|
})}
|
40
44
|
</div>
|
@@ -2,7 +2,6 @@
|
|
2
2
|
import React from 'react'
|
3
3
|
|
4
4
|
import type { LinkDef } from '@hanzo/ui/types'
|
5
|
-
import { LinkElement } from '@hanzo/ui/primitives'
|
6
5
|
import { cn } from '@hanzo/ui/util'
|
7
6
|
import type { LinkDefExtended } from '../../site-def/main-nav'
|
8
7
|
import MobileNavMenuAI from './mobile-nav-menu-ai'
|
@@ -13,68 +12,57 @@ const MobileNav: React.FC<{
|
|
13
12
|
currentAs: string | undefined
|
14
13
|
links: LinkDefExtended[]
|
15
14
|
className?: string
|
16
|
-
commonItemClx?: string | ((def: LinkDef) => string)
|
17
|
-
setChatbotOpen: (open: boolean) => void
|
15
|
+
commonItemClx?: string | ((def: LinkDef) => string)
|
16
|
+
setChatbotOpen: (open: boolean) => void
|
17
|
+
setMenuOpen: (open: boolean) => void
|
18
18
|
/**
|
19
19
|
* This is called *in addition* to the link's actual navigation
|
20
20
|
* action. eg, I link is clicked, and the modal menu is closes
|
21
21
|
*/
|
22
|
-
|
23
|
-
// TODO :aa shouldn't be so aware of parent context!
|
22
|
+
// TODO :aa shouldn't be so aware of parent context!
|
24
23
|
setMenuState: (arg: 'closed' | 'nav' | 'login' | 'bag') => void
|
25
24
|
}> = ({
|
26
25
|
currentAs,
|
27
26
|
links,
|
28
|
-
onAction,
|
29
27
|
setMenuState,
|
30
28
|
className = '',
|
31
29
|
commonItemClx,
|
32
30
|
setChatbotOpen,
|
31
|
+
setMenuOpen
|
33
32
|
}) => (
|
34
|
-
|
33
|
+
links.length > 0 ? (
|
35
34
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
35
|
+
<div className={cn('flex flex-col h-full', className)} >
|
36
|
+
<MobileNavMenuAI setMenuOpen={setMenuOpen} />
|
37
|
+
<div className="flex flex-col flex-1">
|
38
|
+
{links.map((el, index) => {
|
39
|
+
const variant = el.variant ?? 'link'
|
40
|
+
let internalClx = ''
|
41
|
+
// note that linkFG (or any other variant of 'link')
|
42
|
+
// will not get assigned these classes,
|
43
|
+
// and will remain styles is 'foreground' (hence the name)
|
44
|
+
if (variant === 'link') {
|
45
|
+
internalClx += ' text-muted hover:text-foreground active:text-accent rounded-none'
|
46
|
+
if (currentAs && currentAs === el.href) {
|
47
|
+
internalClx += ' text-accent '
|
48
|
+
}
|
49
|
+
}
|
50
|
+
else {
|
51
|
+
internalClx += ' min-w-0'
|
52
|
+
}
|
46
53
|
if (currentAs && currentAs === el.href) {
|
47
|
-
internalClx += '
|
54
|
+
internalClx += ' pointer-events-none'
|
48
55
|
}
|
49
|
-
|
50
|
-
else {
|
51
|
-
internalClx += ' min-w-0'
|
52
|
-
}
|
53
|
-
if (currentAs && currentAs === el.href) {
|
54
|
-
internalClx += ' pointer-events-none'
|
55
|
-
}
|
56
|
-
const itemClx = (commonItemClx) ? (typeof commonItemClx === 'string' ? commonItemClx : commonItemClx(el)) : ''
|
56
|
+
const itemClx = (commonItemClx) ? (typeof commonItemClx === 'string' ? commonItemClx : commonItemClx(el)) : ''
|
57
57
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
// onClick={onAction}
|
65
|
-
// />
|
66
|
-
// )
|
67
|
-
if (el.isAIMenu) {
|
68
|
-
return <MobileNavMenuAI link={el} setChatbotOpen={setChatbotOpen} />
|
69
|
-
}
|
70
|
-
else {
|
71
|
-
return <MobileNavMenuItem link={el} />
|
72
|
-
}
|
73
|
-
})}
|
58
|
+
if (!el.isAIMenu) {
|
59
|
+
return <MobileNavMenuItem link={el} setMenuOpen={setMenuOpen}/>
|
60
|
+
}
|
61
|
+
})}
|
62
|
+
</div>
|
63
|
+
<MobileAuthWidget className=' text-2xl' handleLogin={() => { setMenuState('login') }} />
|
74
64
|
</div>
|
75
|
-
|
76
|
-
|
77
|
-
) : null
|
78
|
-
)
|
65
|
+
) : null
|
66
|
+
)
|
79
67
|
|
80
68
|
export default MobileNav
|
@@ -8,6 +8,7 @@ import { Logo } from '..'
|
|
8
8
|
|
9
9
|
import DesktopBagPopup from '../commerce/desktop-bag-popup'
|
10
10
|
import BagButton from '../commerce/bag-button'
|
11
|
+
import DesktopNav from '../commerce/desktop-nav-menu'
|
11
12
|
|
12
13
|
|
13
14
|
import type { LinkDef } from '@hanzo/ui/types'
|
@@ -35,13 +36,15 @@ const DesktopHeader: React.FC<{
|
|
35
36
|
<Logo size='sm' href='/' className='hidden md:flex lg:hidden' key='one' layout='text-only'/>
|
36
37
|
{/* md or larger */}
|
37
38
|
<div className='flex gap-4 items-center'>
|
38
|
-
<NavItems
|
39
|
+
{/* <NavItems
|
39
40
|
currentAs={currentAs}
|
40
41
|
items={links}
|
41
42
|
className='flex md:gap-4 lg:justify-between lg:gap-7'
|
42
43
|
itemClx='font-nav h-8'
|
43
44
|
key='three'
|
44
|
-
/>
|
45
|
+
/> */}
|
46
|
+
|
47
|
+
<DesktopNav links = {links}/>
|
45
48
|
<DesktopBagPopup popupClx='w-[340px]' trigger={<BagButton className='text-primary -mr-[3px] lg:min-w-0' />} />
|
46
49
|
<AuthWidget/>
|
47
50
|
</div>
|
@@ -17,24 +17,36 @@ const Header: React.FC<{
|
|
17
17
|
}) => {
|
18
18
|
|
19
19
|
// TODO
|
20
|
-
|
20
|
+
const [open, setOpen] = React.useState<boolean>(false);
|
21
21
|
|
22
|
-
|
23
|
-
|
22
|
+
const { nav: { common, featured }, currentAs } = siteDef
|
23
|
+
const links = (featured) ? [...common, ...featured] : common
|
24
|
+
const isDesktopView = (): boolean => {
|
25
|
+
if (typeof window === 'undefined') return false
|
26
|
+
return window.innerWidth > 768
|
27
|
+
}
|
24
28
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
29
|
+
return (<>
|
30
|
+
<DesktopHeader
|
31
|
+
className={cn(className, 'hidden md:flex')}
|
32
|
+
links={links}
|
33
|
+
currentAs={currentAs}
|
34
|
+
/>
|
35
|
+
<MobileHeader
|
36
|
+
className={cn(className, 'md:hidden')}
|
37
|
+
links={links}
|
38
|
+
currentAs={currentAs}
|
39
|
+
setChatbotOpen={setOpen}
|
40
|
+
/>
|
41
|
+
{isDesktopView() && (
|
42
|
+
<ChatWidget
|
43
|
+
title='LUX'
|
44
|
+
subtitle='AI'
|
45
|
+
chatbotUrl='https://lux.chat/iframe'
|
46
|
+
suggestedQuestions={siteDef.chatbot?.suggestedQuestions ?? []}
|
47
|
+
/>
|
48
|
+
)}
|
49
|
+
</>)
|
50
|
+
}
|
39
51
|
|
40
52
|
export default Header
|