@ichaingo/header 1.3.6 → 1.3.71
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/dist/index.js +164 -176
- package/package.json +12 -12
package/dist/index.js
CHANGED
|
@@ -1,138 +1,133 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as e, jsxs as
|
|
2
|
+
import { jsx as e, jsxs as a, Fragment as k } from "react/jsx-runtime";
|
|
3
3
|
import p from "@ichaingo/link";
|
|
4
|
-
import { DropdownMenu as
|
|
5
|
-
import
|
|
6
|
-
import { useState as
|
|
7
|
-
import
|
|
8
|
-
import { useLocale as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
|
|
21
|
-
function ne({
|
|
4
|
+
import { DropdownMenu as z, DropdownMenuTrigger as O, DropdownMenuContent as X, DropdownMenuGroup as G, DropdownMenuItem as M } from "@ichaingo/ui/dropdown-menu";
|
|
5
|
+
import m from "@ichaingo/translation";
|
|
6
|
+
import { useState as v, useMemo as K, useEffect as x, useCallback as w } from "react";
|
|
7
|
+
import N from "@ichaingo/better-link";
|
|
8
|
+
import { useLocale as b, useTranslations as U } from "next-intl";
|
|
9
|
+
import y from "@ichaingo/avatar";
|
|
10
|
+
import { logout as $, fetchUserProfile as F } from "@ichaingo/auth";
|
|
11
|
+
import { twMerge as c } from "tailwind-merge";
|
|
12
|
+
import { Accordion as C, AccordionItem as A, AccordionTrigger as T, AccordionContent as P } from "@ichaingo/ui/accordion";
|
|
13
|
+
import R from "@ichaingo/image";
|
|
14
|
+
import { Popover as W, PopoverTrigger as q, PopoverContent as Q } from "@ichaingo/ui/popover";
|
|
15
|
+
import { PopoverArrow as V } from "@radix-ui/react-popover";
|
|
16
|
+
import { useSearchParams as J, usePathname as j } from "next/navigation";
|
|
17
|
+
import Y from "@ichaingo/theme-toggle";
|
|
18
|
+
import Z from "rc-drawer";
|
|
19
|
+
import { Menu as I, X as ee } from "lucide-react";
|
|
20
|
+
function re({
|
|
22
21
|
userInfo: t
|
|
23
22
|
}) {
|
|
24
|
-
const { gotoLogin: r } =
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
locale:
|
|
28
|
-
theme: o || "",
|
|
23
|
+
const { gotoLogin: r } = N(), [n, l] = v(""), i = b(), s = K(() => t == null ? void 0 : t.id, [t]);
|
|
24
|
+
return x(() => {
|
|
25
|
+
l(r({
|
|
26
|
+
locale: i,
|
|
29
27
|
redirect: window.location.href
|
|
30
28
|
}));
|
|
31
|
-
}, [
|
|
29
|
+
}, [i, r]), s ? (
|
|
32
30
|
// userInfo?.profileUrl
|
|
33
31
|
// https://images.ichaingo.com/user-profile/100000201.png
|
|
34
|
-
/* @__PURE__ */ e(
|
|
32
|
+
/* @__PURE__ */ e(y, { userInfo: t, className: "w-8 h-8" })
|
|
35
33
|
) : /* @__PURE__ */ e(
|
|
36
34
|
p,
|
|
37
35
|
{
|
|
38
|
-
href:
|
|
36
|
+
href: n,
|
|
39
37
|
className: "cursor-pointer text-sm text-white bg-primary py-2 px-3 rounded-lg",
|
|
40
38
|
replace: !0,
|
|
41
|
-
children: /* @__PURE__ */ e(
|
|
39
|
+
children: /* @__PURE__ */ e(m, { value: "signIn", parentKey: "account" })
|
|
42
40
|
}
|
|
43
41
|
);
|
|
44
42
|
}
|
|
45
|
-
function
|
|
46
|
-
const r =
|
|
47
|
-
await
|
|
43
|
+
function B({ className: t }) {
|
|
44
|
+
const r = w(async () => {
|
|
45
|
+
await $();
|
|
48
46
|
}, []);
|
|
49
47
|
return /* @__PURE__ */ e(
|
|
50
48
|
"button",
|
|
51
49
|
{
|
|
52
50
|
onClick: r,
|
|
53
|
-
className:
|
|
54
|
-
children: /* @__PURE__ */ e(
|
|
51
|
+
className: c("cursor-pointer relative", t),
|
|
52
|
+
children: /* @__PURE__ */ e(m, { value: "logout", parentKey: "account" })
|
|
55
53
|
}
|
|
56
54
|
);
|
|
57
55
|
}
|
|
58
|
-
function
|
|
56
|
+
function te({
|
|
59
57
|
list: t,
|
|
60
58
|
userInfo: r,
|
|
61
|
-
onClick:
|
|
59
|
+
onClick: n
|
|
62
60
|
}) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
/* @__PURE__ */ e(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
/* @__PURE__ */ s("div", { className: "flex flex-col overflow-hidden", children: [
|
|
61
|
+
return /* @__PURE__ */ a(z, { children: [
|
|
62
|
+
/* @__PURE__ */ e(O, { className: "outline-none cursor-pointer", children: /* @__PURE__ */ e(re, { userInfo: r }) }),
|
|
63
|
+
/* @__PURE__ */ e(X, { align: "end", className: "z-2000 w-75 p-0 border-transparent outline-none border border-stroke", children: /* @__PURE__ */ a(G, { className: "flex flex-col gap-2 p-3 bg-module rounded-md", children: [
|
|
64
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col gap-3 w-full bg-background rounded-lg p-2", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
65
|
+
/* @__PURE__ */ e(y, { userInfo: r, className: "w-8 h-8" }),
|
|
66
|
+
/* @__PURE__ */ a("div", { className: "flex flex-col overflow-hidden", children: [
|
|
70
67
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium", children: (r == null ? void 0 : r.username) || "--" }),
|
|
71
68
|
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground w-full truncate", children: (r == null ? void 0 : r.email) || (r == null ? void 0 : r.walletAddress) })
|
|
72
69
|
] })
|
|
73
70
|
] }) }),
|
|
74
|
-
t.map((
|
|
71
|
+
t.map((l) => /* @__PURE__ */ e(M, { className: "px-0 py-0 focus-visible:border-none focus-visible:outline-none", children: /* @__PURE__ */ e("div", { className: "flex items-center gap-2 w-full", children: l.name === "logout" ? /* @__PURE__ */ e(B, { className: "flex-1 flex py-3 border-t border-stroke w-full px-2 hover:bg-background" }) : /* @__PURE__ */ e(p, { href: `/${l.href}`, baseUrl: process.env.NEXT_PUBLIC_AUTH_URL, className: "flex-1 flex py-3 h-full w-full px-2 hover:bg-background rounded-lg ", onClick: n, children: /* @__PURE__ */ e(m, { value: l.name, parentKey: "account" }) }) }) }, l.name))
|
|
75
72
|
] }) })
|
|
76
73
|
] });
|
|
77
74
|
}
|
|
78
|
-
function
|
|
75
|
+
function le({
|
|
79
76
|
list: t,
|
|
80
77
|
userInfo: r,
|
|
81
|
-
onClick:
|
|
78
|
+
onClick: n
|
|
82
79
|
}) {
|
|
83
|
-
const { resolvedTheme: n } = f();
|
|
84
80
|
return /* @__PURE__ */ e(
|
|
85
|
-
|
|
81
|
+
C,
|
|
86
82
|
{
|
|
87
83
|
type: "single",
|
|
88
84
|
collapsible: !0,
|
|
89
85
|
className: "w-full",
|
|
90
86
|
defaultValue: "",
|
|
91
|
-
children: /* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */ e(
|
|
93
|
-
/* @__PURE__ */ e(
|
|
94
|
-
/* @__PURE__ */
|
|
87
|
+
children: /* @__PURE__ */ a(A, { value: "item-1", className: "p-0 w-full border border-none", children: [
|
|
88
|
+
/* @__PURE__ */ e(T, { className: "w-full bg-background p-3 flex items-center justify-between", children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-3 w-full overflow-hidden", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
89
|
+
/* @__PURE__ */ e(y, { userInfo: r, className: "w-8 h-8 shrink-0" }),
|
|
90
|
+
/* @__PURE__ */ a("div", { className: "flex flex-col overflow-hidden", children: [
|
|
95
91
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium", children: r == null ? void 0 : r.username }),
|
|
96
92
|
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground w-full truncate", children: (r == null ? void 0 : r.email) || (r == null ? void 0 : r.walletAddress) })
|
|
97
93
|
] })
|
|
98
94
|
] }) }) }),
|
|
99
|
-
/* @__PURE__ */ e(
|
|
95
|
+
/* @__PURE__ */ e(P, { className: "flex text-sm flex-col text-balance bg-background rounded-lg p-3 gap-3 mt-[10px]", children: /* @__PURE__ */ e("dl", { children: t.map((l) => /* @__PURE__ */ e(
|
|
100
96
|
"dd",
|
|
101
97
|
{
|
|
102
98
|
className: "flex justify-start items-center gap-2 py-2",
|
|
103
|
-
children: /* @__PURE__ */ e(p, { href: `/${
|
|
99
|
+
children: /* @__PURE__ */ e(p, { href: `/${l.href}`, className: "flex-1 py-2", onClick: n, suppressHydrationWarning: !0, baseUrl: process.env.NEXT_PUBLIC_AUTH_URL, children: /* @__PURE__ */ e(m, { value: l.name, parentKey: "account" }) })
|
|
104
100
|
},
|
|
105
|
-
|
|
101
|
+
l.name
|
|
106
102
|
)) }) })
|
|
107
103
|
] })
|
|
108
104
|
}
|
|
109
105
|
);
|
|
110
106
|
}
|
|
111
|
-
function
|
|
107
|
+
function S({ onClick: t = () => {
|
|
112
108
|
}, className: r }) {
|
|
113
|
-
const
|
|
114
|
-
return
|
|
115
|
-
|
|
116
|
-
locale:
|
|
117
|
-
theme: n || a || "",
|
|
109
|
+
const n = b(), { gotoLogin: l } = N(), [i, s] = v("");
|
|
110
|
+
return x(() => {
|
|
111
|
+
s(l({
|
|
112
|
+
locale: n,
|
|
118
113
|
redirect: window.location.href
|
|
119
114
|
}));
|
|
120
|
-
}, [
|
|
115
|
+
}, [n, l]), /* @__PURE__ */ e(
|
|
121
116
|
p,
|
|
122
117
|
{
|
|
123
118
|
href: i,
|
|
124
119
|
onClick: t,
|
|
125
120
|
baseUrl: process.env.NEXT_PUBLIC_AUTH_URL,
|
|
126
121
|
replace: !0,
|
|
127
|
-
className:
|
|
122
|
+
className: c(
|
|
128
123
|
"cursor-pointer text-sm text-white bg-primary py-2 px-3 rounded-lg",
|
|
129
124
|
r
|
|
130
125
|
),
|
|
131
|
-
children: /* @__PURE__ */ e(
|
|
126
|
+
children: /* @__PURE__ */ e(m, { value: "signIn", parentKey: "account" })
|
|
132
127
|
}
|
|
133
128
|
);
|
|
134
129
|
}
|
|
135
|
-
const
|
|
130
|
+
const L = [
|
|
136
131
|
{
|
|
137
132
|
name: "overview",
|
|
138
133
|
href: "user-center"
|
|
@@ -154,159 +149,153 @@ const k = [
|
|
|
154
149
|
href: void 0
|
|
155
150
|
}
|
|
156
151
|
];
|
|
157
|
-
function
|
|
158
|
-
}, className: r, userInfo:
|
|
159
|
-
return
|
|
160
|
-
/* @__PURE__ */ e("div", { className:
|
|
161
|
-
/* @__PURE__ */ e("div", { className:
|
|
162
|
-
] }) : /* @__PURE__ */ e(
|
|
152
|
+
function ne({ onClick: t = (l) => {
|
|
153
|
+
}, className: r, userInfo: n }) {
|
|
154
|
+
return n != null && n.id ? /* @__PURE__ */ a(k, { children: [
|
|
155
|
+
/* @__PURE__ */ e("div", { className: c("hidden md:flex items-center", r), children: /* @__PURE__ */ e(te, { list: L, userInfo: n, onClick: t }) }),
|
|
156
|
+
/* @__PURE__ */ e("div", { className: c("block md:hidden w-full", r), children: /* @__PURE__ */ e(le, { list: L.filter((l) => l.href), userInfo: n, onClick: t }) })
|
|
157
|
+
] }) : /* @__PURE__ */ e(S, { onClick: t, className: c(
|
|
163
158
|
"hidden md:flex cursor-pointer text-sm text-white bg-primary py-2 px-3 rounded-lg",
|
|
164
159
|
"order-3"
|
|
165
160
|
) });
|
|
166
161
|
}
|
|
167
|
-
function
|
|
162
|
+
function _({ onClick: t = () => {
|
|
168
163
|
} }) {
|
|
169
164
|
var g;
|
|
170
|
-
const r =
|
|
171
|
-
{ name:
|
|
172
|
-
{ name:
|
|
173
|
-
{ name:
|
|
174
|
-
{ name:
|
|
175
|
-
{ name:
|
|
176
|
-
],
|
|
177
|
-
(
|
|
178
|
-
const
|
|
179
|
-
return
|
|
165
|
+
const r = b(), n = J(), l = U("lang"), i = U("setting"), s = [
|
|
166
|
+
{ name: l("en"), lang: "en" },
|
|
167
|
+
{ name: l("zh-hant"), lang: "zh-hant" },
|
|
168
|
+
{ name: l("zh-hans"), lang: "zh-hans" },
|
|
169
|
+
{ name: l("ja"), lang: "ja" },
|
|
170
|
+
{ name: l("ko"), lang: "ko" }
|
|
171
|
+
], f = j(), h = w(
|
|
172
|
+
(d) => {
|
|
173
|
+
const u = f.replace(new RegExp(`/${r}(/|$)`), `/${d}$1`), o = n.toString();
|
|
174
|
+
return o ? `${u}?${o}` : u;
|
|
180
175
|
},
|
|
181
|
-
[
|
|
176
|
+
[f, r, n]
|
|
182
177
|
);
|
|
183
|
-
return /* @__PURE__ */
|
|
184
|
-
/* @__PURE__ */ e("div", { className: "flex w-full justify-between items-center", children: /* @__PURE__ */ e(
|
|
185
|
-
/* @__PURE__ */ e(
|
|
186
|
-
/* @__PURE__ */ e("span", { className: "text-title", children:
|
|
187
|
-
/* @__PURE__ */ e("span", { className: "text-title", children: (g =
|
|
178
|
+
return /* @__PURE__ */ a("div", { className: "text-sm gap-2 flex flex-col justify-start items-start md:py-2", children: [
|
|
179
|
+
/* @__PURE__ */ e("div", { className: "flex w-full justify-between items-center", children: /* @__PURE__ */ e(C, { type: "single", className: "flex-1", collapsible: !0, children: /* @__PURE__ */ a(A, { value: r, className: "border-0", children: [
|
|
180
|
+
/* @__PURE__ */ e(T, { className: "p-2 bg-background rounded-lg h-11 md:h-auto text-gray-500 w-full flex py-2 justify-between items-center hover:no-underline focus-visible:ring-0 focus-visible:ring-offset-0", children: /* @__PURE__ */ a("div", { className: "flex w-full justify-between items-center", children: [
|
|
181
|
+
/* @__PURE__ */ e("span", { className: "text-title", children: i("language") }),
|
|
182
|
+
/* @__PURE__ */ e("span", { className: "text-title", children: (g = s.find((d) => d.lang === r)) == null ? void 0 : g.name })
|
|
188
183
|
] }) }),
|
|
189
|
-
/* @__PURE__ */ e(
|
|
184
|
+
/* @__PURE__ */ e(P, { className: "bg-background mt-3 rounded-lg flex flex-col gap-2", children: s.map((d) => /* @__PURE__ */ e(
|
|
190
185
|
p,
|
|
191
186
|
{
|
|
192
187
|
prefetch: !1,
|
|
193
188
|
withLocale: !1,
|
|
194
|
-
className:
|
|
189
|
+
className: c(
|
|
195
190
|
"p-2 rounded-lg flex w-full justify-between items-center",
|
|
196
|
-
r ===
|
|
191
|
+
r === d.lang ? "text-primary" : ""
|
|
197
192
|
),
|
|
198
|
-
href:
|
|
193
|
+
href: h(d.lang),
|
|
199
194
|
onClick: t,
|
|
200
|
-
children:
|
|
195
|
+
children: d.name
|
|
201
196
|
},
|
|
202
|
-
|
|
197
|
+
d.lang
|
|
203
198
|
)) })
|
|
204
199
|
] }) }) }),
|
|
205
|
-
/* @__PURE__ */
|
|
206
|
-
/* @__PURE__ */ e("div", { children:
|
|
207
|
-
/* @__PURE__ */ e(
|
|
200
|
+
/* @__PURE__ */ a("div", { className: "bg-background p-2 rounded-lg h-11 md:h-auto flex w-full justify-between items-center", children: [
|
|
201
|
+
/* @__PURE__ */ e("div", { children: i("theme") }),
|
|
202
|
+
/* @__PURE__ */ e(Y, {})
|
|
208
203
|
] })
|
|
209
204
|
] });
|
|
210
205
|
}
|
|
211
|
-
function
|
|
206
|
+
function ae({ onClick: t = () => {
|
|
212
207
|
} }) {
|
|
213
|
-
return /* @__PURE__ */
|
|
214
|
-
/* @__PURE__ */ e("div", { className: "hidden md:flex items-center bg-module rounded-lg p-1.5 cursor-pointer", children: /* @__PURE__ */
|
|
215
|
-
/* @__PURE__ */ e(
|
|
216
|
-
/* @__PURE__ */
|
|
217
|
-
|
|
208
|
+
return /* @__PURE__ */ a("div", { className: "w-full md:w-auto order-3 md:order-0", children: [
|
|
209
|
+
/* @__PURE__ */ e("div", { className: "hidden md:flex items-center bg-module rounded-lg p-1.5 cursor-pointer", children: /* @__PURE__ */ a(W, { children: [
|
|
210
|
+
/* @__PURE__ */ e(q, { asChild: !0, children: /* @__PURE__ */ e(R, { src: `${process.env.NEXT_PUBLIC_CDN_URL}/common/user/5c4a8103-f01c-488a-9d5e-7ef5e442353e.png`, width: 24, height: 24 }) }),
|
|
211
|
+
/* @__PURE__ */ a(
|
|
212
|
+
Q,
|
|
218
213
|
{
|
|
219
214
|
side: "bottom",
|
|
220
215
|
className: "relative top-[10px] rounded-xl border border-stroke bg-module p-2 w-72 z-1000",
|
|
221
216
|
children: [
|
|
222
|
-
/* @__PURE__ */ e(
|
|
223
|
-
/* @__PURE__ */ e(
|
|
217
|
+
/* @__PURE__ */ e(V, { className: "fill-module" }),
|
|
218
|
+
/* @__PURE__ */ e(_, { onClick: t })
|
|
224
219
|
]
|
|
225
220
|
}
|
|
226
221
|
)
|
|
227
222
|
] }) }),
|
|
228
|
-
/* @__PURE__ */ e("div", { className: "md:hidden", children: /* @__PURE__ */ e(
|
|
223
|
+
/* @__PURE__ */ e("div", { className: "md:hidden", children: /* @__PURE__ */ e(_, {}) })
|
|
229
224
|
] });
|
|
230
225
|
}
|
|
231
|
-
const
|
|
226
|
+
const E = {
|
|
232
227
|
PROFILE_UPDATED: "user-profile-updated",
|
|
233
228
|
LOGGED_IN: "user-logged-in",
|
|
234
229
|
LOGGED_OUT: "user-logged-out"
|
|
235
230
|
};
|
|
236
|
-
function
|
|
237
|
-
const
|
|
238
|
-
window.dispatchEvent(
|
|
231
|
+
function Ae(t, r) {
|
|
232
|
+
const n = new CustomEvent(t, { detail: r });
|
|
233
|
+
window.dispatchEvent(n);
|
|
239
234
|
}
|
|
240
|
-
function
|
|
241
|
-
const
|
|
242
|
-
r(
|
|
235
|
+
function se(t, r) {
|
|
236
|
+
const n = (l) => {
|
|
237
|
+
r(l.detail);
|
|
243
238
|
};
|
|
244
|
-
return window.addEventListener(t,
|
|
239
|
+
return window.addEventListener(t, n), () => window.removeEventListener(t, n);
|
|
245
240
|
}
|
|
246
|
-
function
|
|
241
|
+
function ie(t, r) {
|
|
247
242
|
window.removeEventListener(t, r);
|
|
248
243
|
}
|
|
249
|
-
function
|
|
250
|
-
}, hideNews: r = !1, hideLogin:
|
|
251
|
-
const { gotoAISQL:
|
|
244
|
+
function H({ onClick: t = () => {
|
|
245
|
+
}, hideNews: r = !1, hideLogin: n = !1 }) {
|
|
246
|
+
const { gotoAISQL: l, gotoChat: i } = N(), s = b(), f = j(), [h, g] = v(null), d = [
|
|
252
247
|
{
|
|
253
248
|
baseUrl: process.env.NEXT_PUBLIC_ICHAINGO_SEARCH_BASEURL,
|
|
254
|
-
href:
|
|
249
|
+
href: "/explorer",
|
|
255
250
|
key: "/explorer",
|
|
256
|
-
label: /* @__PURE__ */ e("span", { className: "whitespace-nowrap leading-11 md:leading-[34px]", children: /* @__PURE__ */ e(
|
|
251
|
+
label: /* @__PURE__ */ e("span", { className: "whitespace-nowrap leading-11 md:leading-[34px]", children: /* @__PURE__ */ e(m, { value: "title", parentKey: "browser" }) })
|
|
257
252
|
},
|
|
258
253
|
{
|
|
259
254
|
baseUrl: process.env.NEXT_PUBLIC_CHAT_URL,
|
|
260
|
-
href:
|
|
261
|
-
theme: i || m,
|
|
262
|
-
locale: o
|
|
263
|
-
}),
|
|
255
|
+
href: i({ locale: s }),
|
|
264
256
|
key: "/chat",
|
|
265
|
-
label: /* @__PURE__ */
|
|
257
|
+
label: /* @__PURE__ */ a("span", { className: "whitespace-nowrap leading-11 md:leading-[34px]", children: [
|
|
266
258
|
/* @__PURE__ */ e("span", { role: "img", "aria-label": "hot", children: "🔥" }),
|
|
267
259
|
/* @__PURE__ */ e("span", { children: "iGoChat" })
|
|
268
260
|
] })
|
|
269
261
|
},
|
|
270
262
|
{
|
|
271
263
|
baseUrl: process.env.NEXT_PUBLIC_CHAT_URL,
|
|
272
|
-
href:
|
|
273
|
-
theme: i || m,
|
|
274
|
-
locale: o
|
|
275
|
-
}),
|
|
264
|
+
href: l({ locale: s }),
|
|
276
265
|
key: "/sql",
|
|
277
266
|
label: "AISQL"
|
|
278
267
|
},
|
|
279
268
|
{
|
|
280
269
|
baseUrl: process.env.NEXT_PUBLIC_ICHAINGO_SEARCH_BASEURL,
|
|
281
|
-
href:
|
|
270
|
+
href: "/etf/btc-us",
|
|
282
271
|
key: "/etf",
|
|
283
|
-
label: /* @__PURE__ */ e(
|
|
272
|
+
label: /* @__PURE__ */ e(m, { value: "etf", parentKey: "menu" })
|
|
284
273
|
},
|
|
285
274
|
{
|
|
286
275
|
baseUrl: process.env.NEXT_PUBLIC_ICHAINGO_SEARCH_BASEURL,
|
|
287
|
-
href:
|
|
276
|
+
href: "/news",
|
|
288
277
|
key: "/news",
|
|
289
|
-
label: /* @__PURE__ */ e(
|
|
278
|
+
label: /* @__PURE__ */ e(m, { value: "news", parentKey: "menu" })
|
|
290
279
|
},
|
|
291
280
|
{
|
|
292
281
|
baseUrl: process.env.NEXT_PUBLIC_ICHAINGO_SEARCH_BASEURL,
|
|
293
|
-
href:
|
|
282
|
+
href: "/ranking/token",
|
|
294
283
|
key: "/ranking",
|
|
295
|
-
label: /* @__PURE__ */ e(
|
|
284
|
+
label: /* @__PURE__ */ e(m, { value: "ranking", parentKey: "menu" })
|
|
296
285
|
}
|
|
297
|
-
].filter((
|
|
298
|
-
|
|
299
|
-
|
|
286
|
+
].filter((o) => r ? !["/explorer", "/chat", "/sql"].includes(o.key) : !0), u = w(() => {
|
|
287
|
+
F().then((o) => {
|
|
288
|
+
g(o);
|
|
300
289
|
});
|
|
301
290
|
}, []);
|
|
302
|
-
return
|
|
303
|
-
|
|
304
|
-
}, [
|
|
305
|
-
|
|
306
|
-
}), [
|
|
291
|
+
return x(() => {
|
|
292
|
+
u();
|
|
293
|
+
}, [u]), x(() => (se(E.PROFILE_UPDATED, u), () => {
|
|
294
|
+
ie(E.PROFILE_UPDATED, u);
|
|
295
|
+
}), [u]), /* @__PURE__ */ a(
|
|
307
296
|
"nav",
|
|
308
297
|
{
|
|
309
|
-
className:
|
|
298
|
+
className: c(
|
|
310
299
|
"flex flex-col justify-start items-start md:px-3",
|
|
311
300
|
"md:flex-row md:justify-end md:items-start md:px-0",
|
|
312
301
|
"md:gap-6"
|
|
@@ -315,47 +304,46 @@ function z({ onClick: t = () => {
|
|
|
315
304
|
/* @__PURE__ */ e(
|
|
316
305
|
"ul",
|
|
317
306
|
{
|
|
318
|
-
className:
|
|
307
|
+
className: c(
|
|
319
308
|
"flex flex-col justify-start items-start w-full h-full text-sm leading-[44px] z-1001 text-title",
|
|
320
309
|
"md:flex-row md:items-center md:w-auto md:h-[34px] md:leading-[34px] md:gap-6",
|
|
321
310
|
"order-2 md:order-0"
|
|
322
311
|
),
|
|
323
|
-
children:
|
|
312
|
+
children: d.map((o, D) => /* @__PURE__ */ e("li", { className: c("w-full md:w-auto h-11 md:h-auto cursor-pointer", f.includes(o.key) && "border-b-2 border-primary text-primary "), children: /* @__PURE__ */ e(p, { href: o.href, onClick: t, className: "h-full flex items-center justify-start", baseUrl: o.baseUrl, suppressHydrationWarning: !0, children: o.label }) }, D))
|
|
324
313
|
}
|
|
325
314
|
),
|
|
326
|
-
/* @__PURE__ */ e(
|
|
327
|
-
!
|
|
328
|
-
/* @__PURE__ */ e(
|
|
329
|
-
|
|
315
|
+
/* @__PURE__ */ e(ae, { onClick: t }),
|
|
316
|
+
!f.includes("/login") && !n ? /* @__PURE__ */ a(k, { children: [
|
|
317
|
+
/* @__PURE__ */ e(ne, { onClick: t, userInfo: h }),
|
|
318
|
+
h != null && h.id ? /* @__PURE__ */ e("div", { className: "flex md:hidden h-11 md:h-auto cursor-pointer whitespace-nowrap order-3 bg-background rounded-lg p-2 mt-3 w-full items-center justify-center text-subtitle", children: /* @__PURE__ */ e(B, {}) }) : /* @__PURE__ */ e(S, { onClick: t, className: "flex md:hidden h-11 cursor-pointer whitespace-nowrap order-3 bg-primary text-[#fff] rounded-lg p-2 mt-3 w-full items-center justify-center" })
|
|
330
319
|
] }) : null
|
|
331
320
|
]
|
|
332
321
|
}
|
|
333
322
|
);
|
|
334
323
|
}
|
|
335
|
-
function
|
|
336
|
-
const [
|
|
337
|
-
if (!
|
|
338
|
-
return /* @__PURE__ */ e(
|
|
339
|
-
const
|
|
340
|
-
|
|
324
|
+
function oe({ hideLogin: t, hideNews: r }) {
|
|
325
|
+
const [n, l] = v(!1);
|
|
326
|
+
if (!n)
|
|
327
|
+
return /* @__PURE__ */ e(I, { onClick: () => l(!0), size: 32, style: { color: "var(--title)" }, className: "md:hidden ml-2.5 bg-module rounded-lg p-[4px] " });
|
|
328
|
+
const i = (s) => {
|
|
329
|
+
s == null || s.preventDefault(), s == null || s.stopPropagation(), l(!1);
|
|
341
330
|
};
|
|
342
|
-
return /* @__PURE__ */ e(
|
|
343
|
-
/* @__PURE__ */ e("div", { className: "flex justify-end items-center p-2", children: /* @__PURE__ */ e(
|
|
344
|
-
/* @__PURE__ */ e(
|
|
331
|
+
return /* @__PURE__ */ e(Z, { open: n, placement: "right", className: "block md:hidden fixed top-0 bottom-0 left-0 right-0 z-1001 bg-background p-2", children: /* @__PURE__ */ a("div", { className: "w-full max-h-full overflow-y-auto p-3 bg-module rounded-lg", children: [
|
|
332
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end items-center p-2", children: /* @__PURE__ */ e(ee, { size: 24, style: { color: "var(--title)" }, onClick: (s) => i(s) }) }),
|
|
333
|
+
/* @__PURE__ */ e(H, { onClick: (s) => i(s), hideLogin: t, hideNews: r })
|
|
345
334
|
] }) });
|
|
346
335
|
}
|
|
347
|
-
function
|
|
348
|
-
return /* @__PURE__ */
|
|
349
|
-
/* @__PURE__ */ e(
|
|
350
|
-
/* @__PURE__ */ e("div", { className: "hidden md:block", children: /* @__PURE__ */ e(
|
|
336
|
+
function ce({ hideNews: t, hideLogin: r }) {
|
|
337
|
+
return /* @__PURE__ */ a("div", { className: "flex justify-end items-center md:gap-10 z-1001 ", children: [
|
|
338
|
+
/* @__PURE__ */ e(oe, { hideLogin: r, hideNews: t }),
|
|
339
|
+
/* @__PURE__ */ e("div", { className: "hidden md:block", children: /* @__PURE__ */ e(H, { hideNews: t, hideLogin: r }) })
|
|
351
340
|
] });
|
|
352
341
|
}
|
|
353
|
-
function
|
|
354
|
-
|
|
355
|
-
return /* @__PURE__ */ e(p, { suppressHydrationWarning: !0, href: `/?theme=${t || r}`, baseUrl: process.env.NEXT_PUBLIC_ICHAINGO_SEARCH_BASEURL, className: d(
|
|
342
|
+
function de() {
|
|
343
|
+
return /* @__PURE__ */ e(p, { suppressHydrationWarning: !0, href: "/", baseUrl: process.env.NEXT_PUBLIC_ICHAINGO_SEARCH_BASEURL, className: c(
|
|
356
344
|
"w-auto shrink-0 block"
|
|
357
345
|
), children: /* @__PURE__ */ e(
|
|
358
|
-
|
|
346
|
+
R,
|
|
359
347
|
{
|
|
360
348
|
src: "https://cdn.ichaingo.com/uploads/logo_20250526_9aa337bef7.png",
|
|
361
349
|
width: 116,
|
|
@@ -366,21 +354,21 @@ function he() {
|
|
|
366
354
|
}
|
|
367
355
|
) });
|
|
368
356
|
}
|
|
369
|
-
function
|
|
370
|
-
return /* @__PURE__ */
|
|
371
|
-
/* @__PURE__ */
|
|
372
|
-
/* @__PURE__ */
|
|
373
|
-
/* @__PURE__ */ e(
|
|
357
|
+
function Te({ extra: t, children: r, className: n, hideNews: l, hideLogin: i }) {
|
|
358
|
+
return /* @__PURE__ */ a("div", { className: c("sticky left-0 right-0 top-0 bg-background h-16 z-999", n), children: [
|
|
359
|
+
/* @__PURE__ */ a("div", { className: "md:bg-module h-13 text-center flex flex-wrap justify-between items-center gap-2 px-4", children: [
|
|
360
|
+
/* @__PURE__ */ a("div", { className: "flex items-center flex-1 gap-6", children: [
|
|
361
|
+
/* @__PURE__ */ e(de, {}),
|
|
374
362
|
r
|
|
375
363
|
] }),
|
|
376
|
-
/* @__PURE__ */ e(
|
|
364
|
+
/* @__PURE__ */ e(ce, { hideNews: l, hideLogin: i })
|
|
377
365
|
] }),
|
|
378
366
|
t
|
|
379
367
|
] });
|
|
380
368
|
}
|
|
381
369
|
export {
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
370
|
+
E as USER_EVENTS,
|
|
371
|
+
Te as default,
|
|
372
|
+
Ae as emitUserEvent,
|
|
373
|
+
se as onUserEvent
|
|
386
374
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ichaingo/header",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.71",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -22,23 +22,23 @@
|
|
|
22
22
|
"js-cookie": "^3.0.5",
|
|
23
23
|
"lucide-react": "^0.539.0",
|
|
24
24
|
"next-intl": "^4.3.4",
|
|
25
|
-
"next-themes": "^0.4.
|
|
25
|
+
"@ichaingo/next-themes": "^0.4.11",
|
|
26
26
|
"rc-drawer": "^1.0.1",
|
|
27
27
|
"react": "^19.1.0",
|
|
28
28
|
"react-dom": "^19.1.0",
|
|
29
29
|
"rollup-plugin-preserve-use-client": "^1.0.0",
|
|
30
30
|
"tailwind-merge": "^2.5.5",
|
|
31
31
|
"next": "15.1.6",
|
|
32
|
-
"@ichaingo/auth": "1.3.
|
|
33
|
-
"@ichaingo/image": "1.3.
|
|
34
|
-
"@ichaingo/
|
|
35
|
-
"@ichaingo/
|
|
36
|
-
"@ichaingo/ui": "1.3.
|
|
37
|
-
"@ichaingo/better-link": "1.3.
|
|
38
|
-
"@ichaingo/
|
|
39
|
-
"@ichaingo/
|
|
40
|
-
"@ichaingo/
|
|
41
|
-
"@ichaingo/
|
|
32
|
+
"@ichaingo/auth": "1.3.71",
|
|
33
|
+
"@ichaingo/image": "1.3.71",
|
|
34
|
+
"@ichaingo/translation": "1.3.71",
|
|
35
|
+
"@ichaingo/link": "1.3.71",
|
|
36
|
+
"@ichaingo/ui": "1.3.71",
|
|
37
|
+
"@ichaingo/better-link": "1.3.71",
|
|
38
|
+
"@ichaingo/theme-toggle": "1.3.71",
|
|
39
|
+
"@ichaingo/i18n": "1.3.71",
|
|
40
|
+
"@ichaingo/avatar": "1.3.71",
|
|
41
|
+
"@ichaingo/providers": "1.3.71"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/js-cookie": "^3.0.6"
|