@ichaingo/header 1.2.3 → 1.2.4
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 +73 -77
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -4,10 +4,10 @@ import p from "@ichaingo/link";
|
|
|
4
4
|
import { DropdownMenu as X, DropdownMenuTrigger as G, DropdownMenuContent as M, DropdownMenuGroup as K, DropdownMenuItem as F } from "@ichaingo/ui/dropdown-menu";
|
|
5
5
|
import u from "@ichaingo/translation";
|
|
6
6
|
import { useState as N, useMemo as W, useEffect as w, useCallback as U } from "react";
|
|
7
|
-
import
|
|
7
|
+
import _ from "@ichaingo/better-link";
|
|
8
8
|
import { useLocale as y, useTranslations as E } from "next-intl";
|
|
9
9
|
import { useTheme as f } from "next-themes";
|
|
10
|
-
import
|
|
10
|
+
import L from "@ichaingo/avatar";
|
|
11
11
|
import { logout as q, fetchUserProfile as Q } from "@ichaingo/auth";
|
|
12
12
|
import { twMerge as d } from "tailwind-merge";
|
|
13
13
|
import { Accordion as P, AccordionItem as R, AccordionTrigger as j, AccordionContent as B } from "@ichaingo/ui/accordion";
|
|
@@ -16,22 +16,22 @@ import { Popover as V, PopoverTrigger as J, PopoverContent as Y } from "@ichaing
|
|
|
16
16
|
import { PopoverArrow as Z } from "@radix-ui/react-popover";
|
|
17
17
|
import { useSearchParams as I, usePathname as H } from "next/navigation";
|
|
18
18
|
import ee from "@ichaingo/theme-toggle";
|
|
19
|
-
import
|
|
20
|
-
import { Menu as
|
|
19
|
+
import te from "rc-drawer";
|
|
20
|
+
import { Menu as re, X as le } from "lucide-react";
|
|
21
21
|
function ne({
|
|
22
|
-
userInfo:
|
|
22
|
+
userInfo: r
|
|
23
23
|
}) {
|
|
24
|
-
const { gotoLogin:
|
|
24
|
+
const { gotoLogin: t } = _(), [l, n] = N(""), a = y(), { resolvedTheme: o } = f(), i = W(() => r == null ? void 0 : r.id, [r]);
|
|
25
25
|
return w(() => {
|
|
26
|
-
n(
|
|
26
|
+
n(t({
|
|
27
27
|
locale: a,
|
|
28
28
|
theme: o || "",
|
|
29
29
|
redirect: window.location.href
|
|
30
30
|
}));
|
|
31
|
-
}, [a, o,
|
|
31
|
+
}, [a, o, t]), i ? (
|
|
32
32
|
// userInfo?.profileUrl
|
|
33
33
|
// https://images.ichaingo.com/user-profile/100000201.png
|
|
34
|
-
/* @__PURE__ */ e(
|
|
34
|
+
/* @__PURE__ */ e(L, { userInfo: r, className: "w-8 h-8" })
|
|
35
35
|
) : /* @__PURE__ */ e(
|
|
36
36
|
p,
|
|
37
37
|
{
|
|
@@ -42,42 +42,42 @@ function ne({
|
|
|
42
42
|
}
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
|
-
function D({ className:
|
|
46
|
-
const
|
|
45
|
+
function D({ className: r }) {
|
|
46
|
+
const t = U(async () => {
|
|
47
47
|
await q();
|
|
48
48
|
}, []);
|
|
49
49
|
return /* @__PURE__ */ e(
|
|
50
50
|
"button",
|
|
51
51
|
{
|
|
52
|
-
onClick:
|
|
53
|
-
className: d("cursor-pointer relative",
|
|
52
|
+
onClick: t,
|
|
53
|
+
className: d("cursor-pointer relative", r),
|
|
54
54
|
children: /* @__PURE__ */ e(u, { value: "logout", parentKey: "account" })
|
|
55
55
|
}
|
|
56
56
|
);
|
|
57
57
|
}
|
|
58
58
|
function ae({
|
|
59
|
-
list:
|
|
60
|
-
userInfo:
|
|
59
|
+
list: r,
|
|
60
|
+
userInfo: t,
|
|
61
61
|
onClick: l
|
|
62
62
|
}) {
|
|
63
63
|
const { resolvedTheme: n } = f();
|
|
64
64
|
return /* @__PURE__ */ s(X, { children: [
|
|
65
|
-
/* @__PURE__ */ e(G, { className: "outline-none cursor-pointer", children: /* @__PURE__ */ e(ne, { userInfo:
|
|
65
|
+
/* @__PURE__ */ e(G, { className: "outline-none cursor-pointer", children: /* @__PURE__ */ e(ne, { userInfo: t }) }),
|
|
66
66
|
/* @__PURE__ */ e(M, { align: "end", className: "z-2000 w-75 p-0 border-transparent outline-none border border-stroke", children: /* @__PURE__ */ s(K, { className: "flex flex-col gap-2 p-3 bg-module rounded-md", children: [
|
|
67
67
|
/* @__PURE__ */ e("div", { className: "flex flex-col gap-3 w-full bg-background rounded-lg p-2", children: /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
68
|
-
/* @__PURE__ */ e(
|
|
68
|
+
/* @__PURE__ */ e(L, { userInfo: t, className: "w-8 h-8" }),
|
|
69
69
|
/* @__PURE__ */ s("div", { className: "flex flex-col overflow-hidden", children: [
|
|
70
|
-
/* @__PURE__ */ e("div", { className: "text-sm font-medium", children: (
|
|
71
|
-
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground w-full truncate", children: (
|
|
70
|
+
/* @__PURE__ */ e("div", { className: "text-sm font-medium", children: (t == null ? void 0 : t.username) || "--" }),
|
|
71
|
+
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground w-full truncate", children: (t == null ? void 0 : t.email) || (t == null ? void 0 : t.walletAddress) })
|
|
72
72
|
] })
|
|
73
73
|
] }) }),
|
|
74
|
-
|
|
74
|
+
r.map((a) => /* @__PURE__ */ e(F, { 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: a.name === "logout" ? /* @__PURE__ */ e(D, { className: "flex-1 flex py-3 border-t border-stroke w-full px-2 hover:bg-background" }) : /* @__PURE__ */ e(p, { href: `/${a.href}?theme=${n}`, 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: l, children: /* @__PURE__ */ e(u, { value: a.name, parentKey: "account" }) }) }) }, a.name))
|
|
75
75
|
] }) })
|
|
76
76
|
] });
|
|
77
77
|
}
|
|
78
78
|
function se({
|
|
79
|
-
list:
|
|
80
|
-
userInfo:
|
|
79
|
+
list: r,
|
|
80
|
+
userInfo: t,
|
|
81
81
|
onClick: l
|
|
82
82
|
}) {
|
|
83
83
|
const { resolvedTheme: n } = f();
|
|
@@ -90,13 +90,13 @@ function se({
|
|
|
90
90
|
defaultValue: "",
|
|
91
91
|
children: /* @__PURE__ */ s(R, { value: "item-1", className: "p-0 w-full border border-none", children: [
|
|
92
92
|
/* @__PURE__ */ e(j, { 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__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
93
|
-
/* @__PURE__ */ e(
|
|
93
|
+
/* @__PURE__ */ e(L, { userInfo: t, className: "w-8 h-8 shrink-0" }),
|
|
94
94
|
/* @__PURE__ */ s("div", { className: "flex flex-col overflow-hidden", children: [
|
|
95
|
-
/* @__PURE__ */ e("div", { className: "text-sm font-medium", children:
|
|
96
|
-
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground w-full truncate", children: (
|
|
95
|
+
/* @__PURE__ */ e("div", { className: "text-sm font-medium", children: t == null ? void 0 : t.username }),
|
|
96
|
+
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground w-full truncate", children: (t == null ? void 0 : t.email) || (t == null ? void 0 : t.walletAddress) })
|
|
97
97
|
] })
|
|
98
98
|
] }) }) }),
|
|
99
|
-
/* @__PURE__ */ e(B, { className: "flex text-sm flex-col text-balance bg-background rounded-lg p-3 gap-3 mt-[10px]", children: /* @__PURE__ */ e("dl", { children:
|
|
99
|
+
/* @__PURE__ */ e(B, { className: "flex text-sm flex-col text-balance bg-background rounded-lg p-3 gap-3 mt-[10px]", children: /* @__PURE__ */ e("dl", { children: r.map((a) => /* @__PURE__ */ e(
|
|
100
100
|
"dd",
|
|
101
101
|
{
|
|
102
102
|
className: "flex justify-start items-center gap-2 py-2",
|
|
@@ -108,9 +108,9 @@ function se({
|
|
|
108
108
|
}
|
|
109
109
|
);
|
|
110
110
|
}
|
|
111
|
-
function $({ onClick:
|
|
112
|
-
}, className:
|
|
113
|
-
const l = y(), { resolvedTheme: n, theme: a } = f(), { gotoLogin: o } =
|
|
111
|
+
function $({ onClick: r = () => {
|
|
112
|
+
}, className: t }) {
|
|
113
|
+
const l = y(), { resolvedTheme: n, theme: a } = f(), { gotoLogin: o } = _(), [i, m] = N("");
|
|
114
114
|
return w(() => {
|
|
115
115
|
m(o({
|
|
116
116
|
locale: l,
|
|
@@ -121,12 +121,12 @@ function $({ onClick: t = () => {
|
|
|
121
121
|
p,
|
|
122
122
|
{
|
|
123
123
|
href: i,
|
|
124
|
-
onClick:
|
|
124
|
+
onClick: r,
|
|
125
125
|
baseUrl: process.env.NEXT_PUBLIC_AUTH_URL,
|
|
126
126
|
replace: !0,
|
|
127
127
|
className: d(
|
|
128
128
|
"cursor-pointer text-sm text-white bg-primary py-2 px-3 rounded-lg",
|
|
129
|
-
|
|
129
|
+
t
|
|
130
130
|
),
|
|
131
131
|
children: /* @__PURE__ */ e(u, { value: "signIn", parentKey: "account" })
|
|
132
132
|
}
|
|
@@ -141,10 +141,6 @@ const k = [
|
|
|
141
141
|
name: "collect",
|
|
142
142
|
href: "user-center/collect"
|
|
143
143
|
},
|
|
144
|
-
{
|
|
145
|
-
name: "privateLabel",
|
|
146
|
-
href: "user-center/private-label"
|
|
147
|
-
},
|
|
148
144
|
{
|
|
149
145
|
name: "setting",
|
|
150
146
|
href: "user-center/setting"
|
|
@@ -154,20 +150,20 @@ const k = [
|
|
|
154
150
|
href: void 0
|
|
155
151
|
}
|
|
156
152
|
];
|
|
157
|
-
function oe({ onClick:
|
|
158
|
-
}, className:
|
|
153
|
+
function oe({ onClick: r = (n) => {
|
|
154
|
+
}, className: t, userInfo: l }) {
|
|
159
155
|
return l != null && l.id ? /* @__PURE__ */ s(A, { children: [
|
|
160
|
-
/* @__PURE__ */ e("div", { className: d("hidden md:flex items-center",
|
|
161
|
-
/* @__PURE__ */ e("div", { className: d("block md:hidden w-full",
|
|
162
|
-
] }) : /* @__PURE__ */ e($, { onClick:
|
|
156
|
+
/* @__PURE__ */ e("div", { className: d("hidden md:flex items-center", t), children: /* @__PURE__ */ e(ae, { list: k, userInfo: l, onClick: r }) }),
|
|
157
|
+
/* @__PURE__ */ e("div", { className: d("block md:hidden w-full", t), children: /* @__PURE__ */ e(se, { list: k.filter((n) => n.href), userInfo: l, onClick: r }) })
|
|
158
|
+
] }) : /* @__PURE__ */ e($, { onClick: r, className: d(
|
|
163
159
|
"hidden md:flex cursor-pointer text-sm text-white bg-primary py-2 px-3 rounded-lg",
|
|
164
160
|
"order-3"
|
|
165
161
|
) });
|
|
166
162
|
}
|
|
167
|
-
function T({ onClick:
|
|
163
|
+
function T({ onClick: r = () => {
|
|
168
164
|
} }) {
|
|
169
165
|
var g;
|
|
170
|
-
const
|
|
166
|
+
const t = y(), l = I(), n = E("lang"), a = E("setting"), o = [
|
|
171
167
|
{ name: n("en"), lang: "en" },
|
|
172
168
|
{ name: n("zh-hant"), lang: "zh-hant" },
|
|
173
169
|
{ name: n("zh-hans"), lang: "zh-hans" },
|
|
@@ -175,16 +171,16 @@ function T({ onClick: t = () => {
|
|
|
175
171
|
{ name: n("ko"), lang: "ko" }
|
|
176
172
|
], i = H(), m = U(
|
|
177
173
|
(c) => {
|
|
178
|
-
const v = i.replace(new RegExp(`/${
|
|
174
|
+
const v = i.replace(new RegExp(`/${t}(/|$)`), `/${c}$1`), b = l.toString();
|
|
179
175
|
return b ? `${v}?${b}` : v;
|
|
180
176
|
},
|
|
181
|
-
[i,
|
|
177
|
+
[i, t, l]
|
|
182
178
|
);
|
|
183
179
|
return /* @__PURE__ */ s("div", { className: "text-sm gap-2 flex flex-col justify-start items-start md:py-2", children: [
|
|
184
|
-
/* @__PURE__ */ e("div", { className: "flex w-full justify-between items-center", children: /* @__PURE__ */ e(P, { type: "single", className: "flex-1", collapsible: !0, children: /* @__PURE__ */ s(R, { value:
|
|
180
|
+
/* @__PURE__ */ e("div", { className: "flex w-full justify-between items-center", children: /* @__PURE__ */ e(P, { type: "single", className: "flex-1", collapsible: !0, children: /* @__PURE__ */ s(R, { value: t, className: "border-0", children: [
|
|
185
181
|
/* @__PURE__ */ e(j, { 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__ */ s("div", { className: "flex w-full justify-between items-center", children: [
|
|
186
182
|
/* @__PURE__ */ e("span", { className: "text-title", children: a("language") }),
|
|
187
|
-
/* @__PURE__ */ e("span", { className: "text-title", children: (g = o.find((c) => c.lang ===
|
|
183
|
+
/* @__PURE__ */ e("span", { className: "text-title", children: (g = o.find((c) => c.lang === t)) == null ? void 0 : g.name })
|
|
188
184
|
] }) }),
|
|
189
185
|
/* @__PURE__ */ e(B, { className: "bg-background mt-3 rounded-lg flex flex-col gap-2", children: o.map((c) => /* @__PURE__ */ e(
|
|
190
186
|
p,
|
|
@@ -193,10 +189,10 @@ function T({ onClick: t = () => {
|
|
|
193
189
|
withLocale: !1,
|
|
194
190
|
className: d(
|
|
195
191
|
"p-2 rounded-lg flex w-full justify-between items-center",
|
|
196
|
-
|
|
192
|
+
t === c.lang ? "text-primary" : ""
|
|
197
193
|
),
|
|
198
194
|
href: m(c.lang),
|
|
199
|
-
onClick:
|
|
195
|
+
onClick: r,
|
|
200
196
|
children: c.name
|
|
201
197
|
},
|
|
202
198
|
c.lang
|
|
@@ -208,7 +204,7 @@ function T({ onClick: t = () => {
|
|
|
208
204
|
] })
|
|
209
205
|
] });
|
|
210
206
|
}
|
|
211
|
-
function ie({ onClick:
|
|
207
|
+
function ie({ onClick: r = () => {
|
|
212
208
|
} }) {
|
|
213
209
|
return /* @__PURE__ */ s("div", { className: "w-full md:w-auto order-3 md:order-0", children: [
|
|
214
210
|
/* @__PURE__ */ e("div", { className: "hidden md:flex items-center bg-module rounded-lg p-1.5 cursor-pointer", children: /* @__PURE__ */ s(V, { children: [
|
|
@@ -220,7 +216,7 @@ function ie({ onClick: t = () => {
|
|
|
220
216
|
className: "relative top-[10px] rounded-xl border border-stroke bg-module p-2 w-72 z-1000",
|
|
221
217
|
children: [
|
|
222
218
|
/* @__PURE__ */ e(Z, { className: "fill-module" }),
|
|
223
|
-
/* @__PURE__ */ e(T, { onClick:
|
|
219
|
+
/* @__PURE__ */ e(T, { onClick: r })
|
|
224
220
|
]
|
|
225
221
|
}
|
|
226
222
|
)
|
|
@@ -233,22 +229,22 @@ const C = {
|
|
|
233
229
|
LOGGED_IN: "user-logged-in",
|
|
234
230
|
LOGGED_OUT: "user-logged-out"
|
|
235
231
|
};
|
|
236
|
-
function je(
|
|
237
|
-
const l = new CustomEvent(
|
|
232
|
+
function je(r, t) {
|
|
233
|
+
const l = new CustomEvent(r, { detail: t });
|
|
238
234
|
window.dispatchEvent(l);
|
|
239
235
|
}
|
|
240
|
-
function ce(
|
|
236
|
+
function ce(r, t) {
|
|
241
237
|
const l = (n) => {
|
|
242
|
-
|
|
238
|
+
t(n.detail);
|
|
243
239
|
};
|
|
244
|
-
return window.addEventListener(
|
|
240
|
+
return window.addEventListener(r, l), () => window.removeEventListener(r, l);
|
|
245
241
|
}
|
|
246
|
-
function de(
|
|
247
|
-
window.removeEventListener(
|
|
242
|
+
function de(r, t) {
|
|
243
|
+
window.removeEventListener(r, t);
|
|
248
244
|
}
|
|
249
|
-
function z({ onClick:
|
|
250
|
-
}, hideNews:
|
|
251
|
-
const { gotoAISQL: n, gotoChat: a } =
|
|
245
|
+
function z({ onClick: r = () => {
|
|
246
|
+
}, hideNews: t = !1, hideLogin: l = !1 }) {
|
|
247
|
+
const { gotoAISQL: n, gotoChat: a } = _(), o = y(), { resolvedTheme: i, theme: m } = f(), g = H(), [c, v] = N(null), b = [
|
|
252
248
|
{
|
|
253
249
|
baseUrl: process.env.NEXT_PUBLIC_ICHAINGO_SEARCH_BASEURL,
|
|
254
250
|
href: `/explorer?theme=${i || m}`,
|
|
@@ -294,7 +290,7 @@ function z({ onClick: t = () => {
|
|
|
294
290
|
key: "/market",
|
|
295
291
|
label: /* @__PURE__ */ e(u, { value: "market", parentKey: "menu" })
|
|
296
292
|
}
|
|
297
|
-
].filter((h) =>
|
|
293
|
+
].filter((h) => t ? !["/explorer", "/chat", "/sql"].includes(h.key) : !0), x = U(() => {
|
|
298
294
|
Q().then((h) => {
|
|
299
295
|
v(h);
|
|
300
296
|
});
|
|
@@ -320,39 +316,39 @@ function z({ onClick: t = () => {
|
|
|
320
316
|
"md:flex-row md:items-center md:w-auto md:h-[34px] md:leading-[34px] md:gap-6",
|
|
321
317
|
"order-2 md:order-0"
|
|
322
318
|
),
|
|
323
|
-
children: b.map((h, O) => /* @__PURE__ */ e("li", { className: d("w-full md:w-auto h-11 md:h-auto cursor-pointer", g.includes(h.key) && "border-b-2 border-primary text-primary "), children: /* @__PURE__ */ e(p, { href: h.href, onClick:
|
|
319
|
+
children: b.map((h, O) => /* @__PURE__ */ e("li", { className: d("w-full md:w-auto h-11 md:h-auto cursor-pointer", g.includes(h.key) && "border-b-2 border-primary text-primary "), children: /* @__PURE__ */ e(p, { href: h.href, onClick: r, className: "h-full flex items-center justify-start", baseUrl: h.baseUrl, suppressHydrationWarning: !0, children: h.label }) }, O))
|
|
324
320
|
}
|
|
325
321
|
),
|
|
326
|
-
/* @__PURE__ */ e(ie, { onClick:
|
|
322
|
+
/* @__PURE__ */ e(ie, { onClick: r }),
|
|
327
323
|
!g.includes("/login") && !l ? /* @__PURE__ */ s(A, { children: [
|
|
328
|
-
/* @__PURE__ */ e(oe, { onClick:
|
|
329
|
-
c != null && c.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(D, {}) }) : /* @__PURE__ */ e($, { onClick:
|
|
324
|
+
/* @__PURE__ */ e(oe, { onClick: r, userInfo: c }),
|
|
325
|
+
c != null && c.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(D, {}) }) : /* @__PURE__ */ e($, { onClick: r, 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
326
|
] }) : null
|
|
331
327
|
]
|
|
332
328
|
}
|
|
333
329
|
);
|
|
334
330
|
}
|
|
335
|
-
function me({ hideLogin:
|
|
331
|
+
function me({ hideLogin: r, hideNews: t }) {
|
|
336
332
|
const [l, n] = N(!1);
|
|
337
333
|
if (!l)
|
|
338
|
-
return /* @__PURE__ */ e(
|
|
334
|
+
return /* @__PURE__ */ e(re, { onClick: () => n(!0), size: 32, style: { color: "var(--title)" }, className: "md:hidden ml-2.5 bg-module rounded-lg p-[4px] " });
|
|
339
335
|
const a = (o) => {
|
|
340
336
|
o == null || o.preventDefault(), o == null || o.stopPropagation(), n(!1);
|
|
341
337
|
};
|
|
342
|
-
return /* @__PURE__ */ e(
|
|
338
|
+
return /* @__PURE__ */ e(te, { open: l, placement: "right", className: "block md:hidden fixed top-0 bottom-0 left-0 right-0 z-1001 bg-background p-2", children: /* @__PURE__ */ s("div", { className: "w-full max-h-full overflow-y-auto p-3 bg-module rounded-lg", children: [
|
|
343
339
|
/* @__PURE__ */ e("div", { className: "flex justify-end items-center p-2", children: /* @__PURE__ */ e(le, { size: 24, style: { color: "var(--title)" }, onClick: (o) => a(o) }) }),
|
|
344
|
-
/* @__PURE__ */ e(z, { onClick: (o) => a(o), hideLogin:
|
|
340
|
+
/* @__PURE__ */ e(z, { onClick: (o) => a(o), hideLogin: r, hideNews: t })
|
|
345
341
|
] }) });
|
|
346
342
|
}
|
|
347
|
-
function ue({ hideNews:
|
|
343
|
+
function ue({ hideNews: r, hideLogin: t }) {
|
|
348
344
|
return /* @__PURE__ */ s("div", { className: "flex justify-end items-center md:gap-10 z-1001 ", children: [
|
|
349
|
-
/* @__PURE__ */ e(me, { hideLogin:
|
|
350
|
-
/* @__PURE__ */ e("div", { className: "hidden md:block", children: /* @__PURE__ */ e(z, { hideNews:
|
|
345
|
+
/* @__PURE__ */ e(me, { hideLogin: t, hideNews: r }),
|
|
346
|
+
/* @__PURE__ */ e("div", { className: "hidden md:block", children: /* @__PURE__ */ e(z, { hideNews: r, hideLogin: t }) })
|
|
351
347
|
] });
|
|
352
348
|
}
|
|
353
349
|
function he() {
|
|
354
|
-
const { resolvedTheme:
|
|
355
|
-
return /* @__PURE__ */ e(p, { suppressHydrationWarning: !0, href: `/?theme=${
|
|
350
|
+
const { resolvedTheme: r, theme: t } = f();
|
|
351
|
+
return /* @__PURE__ */ e(p, { suppressHydrationWarning: !0, href: `/?theme=${r || t}`, baseUrl: process.env.NEXT_PUBLIC_ICHAINGO_SEARCH_BASEURL, className: d(
|
|
356
352
|
"w-auto shrink-0 block"
|
|
357
353
|
), children: /* @__PURE__ */ e(
|
|
358
354
|
S,
|
|
@@ -366,16 +362,16 @@ function he() {
|
|
|
366
362
|
}
|
|
367
363
|
) });
|
|
368
364
|
}
|
|
369
|
-
function Be({ extra:
|
|
365
|
+
function Be({ extra: r, children: t, className: l, hideNews: n, hideLogin: a }) {
|
|
370
366
|
return /* @__PURE__ */ s("div", { className: d("sticky left-0 right-0 top-0 bg-background h-16 z-999", l), children: [
|
|
371
367
|
/* @__PURE__ */ s("div", { className: "md:bg-module h-13 text-center flex flex-wrap justify-between items-center gap-2 px-4", children: [
|
|
372
368
|
/* @__PURE__ */ s("div", { className: "flex items-center flex-1 gap-6", children: [
|
|
373
369
|
/* @__PURE__ */ e(he, {}),
|
|
374
|
-
|
|
370
|
+
t
|
|
375
371
|
] }),
|
|
376
372
|
/* @__PURE__ */ e(ue, { hideNews: n, hideLogin: a })
|
|
377
373
|
] }),
|
|
378
|
-
|
|
374
|
+
r
|
|
379
375
|
] });
|
|
380
376
|
}
|
|
381
377
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ichaingo/header",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -29,16 +29,16 @@
|
|
|
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/
|
|
33
|
-
"@ichaingo/
|
|
34
|
-
"@ichaingo/
|
|
35
|
-
"@ichaingo/
|
|
36
|
-
"@ichaingo/
|
|
37
|
-
"@ichaingo/i18n": "1.2.
|
|
38
|
-
"@ichaingo/
|
|
39
|
-
"@ichaingo/
|
|
40
|
-
"@ichaingo/
|
|
41
|
-
"@ichaingo/
|
|
32
|
+
"@ichaingo/image": "1.2.4",
|
|
33
|
+
"@ichaingo/link": "1.2.4",
|
|
34
|
+
"@ichaingo/ui": "1.2.4",
|
|
35
|
+
"@ichaingo/auth": "1.2.4",
|
|
36
|
+
"@ichaingo/avatar": "1.2.4",
|
|
37
|
+
"@ichaingo/i18n": "1.2.4",
|
|
38
|
+
"@ichaingo/translation": "1.2.4",
|
|
39
|
+
"@ichaingo/providers": "1.2.4",
|
|
40
|
+
"@ichaingo/better-link": "1.2.4",
|
|
41
|
+
"@ichaingo/theme-toggle": "1.2.4"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/js-cookie": "^3.0.6"
|