@ichaingo/header 1.2.1 → 1.2.2
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 +77 -73
- 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 L 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 _ 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 re from "rc-drawer";
|
|
20
|
+
import { Menu as te, X as le } from "lucide-react";
|
|
21
21
|
function ne({
|
|
22
|
-
userInfo:
|
|
22
|
+
userInfo: t
|
|
23
23
|
}) {
|
|
24
|
-
const { gotoLogin:
|
|
24
|
+
const { gotoLogin: r } = L(), [l, n] = N(""), a = y(), { resolvedTheme: o } = f(), i = W(() => t == null ? void 0 : t.id, [t]);
|
|
25
25
|
return w(() => {
|
|
26
|
-
n(
|
|
26
|
+
n(r({
|
|
27
27
|
locale: a,
|
|
28
28
|
theme: o || "",
|
|
29
29
|
redirect: window.location.href
|
|
30
30
|
}));
|
|
31
|
-
}, [a, o,
|
|
31
|
+
}, [a, o, r]), i ? (
|
|
32
32
|
// userInfo?.profileUrl
|
|
33
33
|
// https://images.ichaingo.com/user-profile/100000201.png
|
|
34
|
-
/* @__PURE__ */ e(
|
|
34
|
+
/* @__PURE__ */ e(_, { userInfo: t, 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: t }) {
|
|
46
|
+
const r = 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: r,
|
|
53
|
+
className: d("cursor-pointer relative", t),
|
|
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: t,
|
|
60
|
+
userInfo: r,
|
|
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: r }) }),
|
|
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(_, { userInfo: r, 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: (r == null ? void 0 : r.username) || "--" }),
|
|
71
|
+
/* @__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
72
|
] })
|
|
73
73
|
] }) }),
|
|
74
|
-
|
|
74
|
+
t.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: t,
|
|
80
|
+
userInfo: r,
|
|
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(_, { userInfo: r, 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: r == null ? void 0 : r.username }),
|
|
96
|
+
/* @__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
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: t.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: t = () => {
|
|
112
|
+
}, className: r }) {
|
|
113
|
+
const l = y(), { resolvedTheme: n, theme: a } = f(), { gotoLogin: o } = L(), [i, m] = N("");
|
|
114
114
|
return w(() => {
|
|
115
115
|
m(o({
|
|
116
116
|
locale: l,
|
|
@@ -121,12 +121,12 @@ function $({ onClick: r = () => {
|
|
|
121
121
|
p,
|
|
122
122
|
{
|
|
123
123
|
href: i,
|
|
124
|
-
onClick:
|
|
124
|
+
onClick: t,
|
|
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
|
+
r
|
|
130
130
|
),
|
|
131
131
|
children: /* @__PURE__ */ e(u, { value: "signIn", parentKey: "account" })
|
|
132
132
|
}
|
|
@@ -141,6 +141,10 @@ 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
|
+
},
|
|
144
148
|
{
|
|
145
149
|
name: "setting",
|
|
146
150
|
href: "user-center/setting"
|
|
@@ -150,20 +154,20 @@ const k = [
|
|
|
150
154
|
href: void 0
|
|
151
155
|
}
|
|
152
156
|
];
|
|
153
|
-
function oe({ onClick:
|
|
154
|
-
}, className:
|
|
157
|
+
function oe({ onClick: t = (n) => {
|
|
158
|
+
}, className: r, userInfo: l }) {
|
|
155
159
|
return l != null && l.id ? /* @__PURE__ */ s(A, { children: [
|
|
156
|
-
/* @__PURE__ */ e("div", { className: d("hidden md:flex items-center",
|
|
157
|
-
/* @__PURE__ */ e("div", { className: d("block md:hidden w-full",
|
|
158
|
-
] }) : /* @__PURE__ */ e($, { onClick:
|
|
160
|
+
/* @__PURE__ */ e("div", { className: d("hidden md:flex items-center", r), children: /* @__PURE__ */ e(ae, { list: k, userInfo: l, onClick: t }) }),
|
|
161
|
+
/* @__PURE__ */ e("div", { className: d("block md:hidden w-full", r), children: /* @__PURE__ */ e(se, { list: k.filter((n) => n.href), userInfo: l, onClick: t }) })
|
|
162
|
+
] }) : /* @__PURE__ */ e($, { onClick: t, className: d(
|
|
159
163
|
"hidden md:flex cursor-pointer text-sm text-white bg-primary py-2 px-3 rounded-lg",
|
|
160
164
|
"order-3"
|
|
161
165
|
) });
|
|
162
166
|
}
|
|
163
|
-
function T({ onClick:
|
|
167
|
+
function T({ onClick: t = () => {
|
|
164
168
|
} }) {
|
|
165
169
|
var g;
|
|
166
|
-
const
|
|
170
|
+
const r = y(), l = I(), n = E("lang"), a = E("setting"), o = [
|
|
167
171
|
{ name: n("en"), lang: "en" },
|
|
168
172
|
{ name: n("zh-hant"), lang: "zh-hant" },
|
|
169
173
|
{ name: n("zh-hans"), lang: "zh-hans" },
|
|
@@ -171,16 +175,16 @@ function T({ onClick: r = () => {
|
|
|
171
175
|
{ name: n("ko"), lang: "ko" }
|
|
172
176
|
], i = H(), m = U(
|
|
173
177
|
(c) => {
|
|
174
|
-
const v = i.replace(new RegExp(`/${
|
|
178
|
+
const v = i.replace(new RegExp(`/${r}(/|$)`), `/${c}$1`), b = l.toString();
|
|
175
179
|
return b ? `${v}?${b}` : v;
|
|
176
180
|
},
|
|
177
|
-
[i,
|
|
181
|
+
[i, r, l]
|
|
178
182
|
);
|
|
179
183
|
return /* @__PURE__ */ s("div", { className: "text-sm gap-2 flex flex-col justify-start items-start md:py-2", children: [
|
|
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:
|
|
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: r, className: "border-0", children: [
|
|
181
185
|
/* @__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: [
|
|
182
186
|
/* @__PURE__ */ e("span", { className: "text-title", children: a("language") }),
|
|
183
|
-
/* @__PURE__ */ e("span", { className: "text-title", children: (g = o.find((c) => c.lang ===
|
|
187
|
+
/* @__PURE__ */ e("span", { className: "text-title", children: (g = o.find((c) => c.lang === r)) == null ? void 0 : g.name })
|
|
184
188
|
] }) }),
|
|
185
189
|
/* @__PURE__ */ e(B, { className: "bg-background mt-3 rounded-lg flex flex-col gap-2", children: o.map((c) => /* @__PURE__ */ e(
|
|
186
190
|
p,
|
|
@@ -189,10 +193,10 @@ function T({ onClick: r = () => {
|
|
|
189
193
|
withLocale: !1,
|
|
190
194
|
className: d(
|
|
191
195
|
"p-2 rounded-lg flex w-full justify-between items-center",
|
|
192
|
-
|
|
196
|
+
r === c.lang ? "text-primary" : ""
|
|
193
197
|
),
|
|
194
198
|
href: m(c.lang),
|
|
195
|
-
onClick:
|
|
199
|
+
onClick: t,
|
|
196
200
|
children: c.name
|
|
197
201
|
},
|
|
198
202
|
c.lang
|
|
@@ -204,7 +208,7 @@ function T({ onClick: r = () => {
|
|
|
204
208
|
] })
|
|
205
209
|
] });
|
|
206
210
|
}
|
|
207
|
-
function ie({ onClick:
|
|
211
|
+
function ie({ onClick: t = () => {
|
|
208
212
|
} }) {
|
|
209
213
|
return /* @__PURE__ */ s("div", { className: "w-full md:w-auto order-3 md:order-0", children: [
|
|
210
214
|
/* @__PURE__ */ e("div", { className: "hidden md:flex items-center bg-module rounded-lg p-1.5 cursor-pointer", children: /* @__PURE__ */ s(V, { children: [
|
|
@@ -216,7 +220,7 @@ function ie({ onClick: r = () => {
|
|
|
216
220
|
className: "relative top-[10px] rounded-xl border border-stroke bg-module p-2 w-72 z-1000",
|
|
217
221
|
children: [
|
|
218
222
|
/* @__PURE__ */ e(Z, { className: "fill-module" }),
|
|
219
|
-
/* @__PURE__ */ e(T, { onClick:
|
|
223
|
+
/* @__PURE__ */ e(T, { onClick: t })
|
|
220
224
|
]
|
|
221
225
|
}
|
|
222
226
|
)
|
|
@@ -229,22 +233,22 @@ const C = {
|
|
|
229
233
|
LOGGED_IN: "user-logged-in",
|
|
230
234
|
LOGGED_OUT: "user-logged-out"
|
|
231
235
|
};
|
|
232
|
-
function je(
|
|
233
|
-
const l = new CustomEvent(
|
|
236
|
+
function je(t, r) {
|
|
237
|
+
const l = new CustomEvent(t, { detail: r });
|
|
234
238
|
window.dispatchEvent(l);
|
|
235
239
|
}
|
|
236
|
-
function ce(
|
|
240
|
+
function ce(t, r) {
|
|
237
241
|
const l = (n) => {
|
|
238
|
-
|
|
242
|
+
r(n.detail);
|
|
239
243
|
};
|
|
240
|
-
return window.addEventListener(
|
|
244
|
+
return window.addEventListener(t, l), () => window.removeEventListener(t, l);
|
|
241
245
|
}
|
|
242
|
-
function de(
|
|
243
|
-
window.removeEventListener(
|
|
246
|
+
function de(t, r) {
|
|
247
|
+
window.removeEventListener(t, r);
|
|
244
248
|
}
|
|
245
|
-
function z({ onClick:
|
|
246
|
-
}, hideNews:
|
|
247
|
-
const { gotoAISQL: n, gotoChat: a } =
|
|
249
|
+
function z({ onClick: t = () => {
|
|
250
|
+
}, hideNews: r = !1, hideLogin: l = !1 }) {
|
|
251
|
+
const { gotoAISQL: n, gotoChat: a } = L(), o = y(), { resolvedTheme: i, theme: m } = f(), g = H(), [c, v] = N(null), b = [
|
|
248
252
|
{
|
|
249
253
|
baseUrl: process.env.NEXT_PUBLIC_ICHAINGO_SEARCH_BASEURL,
|
|
250
254
|
href: `/explorer?theme=${i || m}`,
|
|
@@ -290,7 +294,7 @@ function z({ onClick: r = () => {
|
|
|
290
294
|
key: "/market",
|
|
291
295
|
label: /* @__PURE__ */ e(u, { value: "market", parentKey: "menu" })
|
|
292
296
|
}
|
|
293
|
-
].filter((h) =>
|
|
297
|
+
].filter((h) => r ? !["/explorer", "/chat", "/sql"].includes(h.key) : !0), x = U(() => {
|
|
294
298
|
Q().then((h) => {
|
|
295
299
|
v(h);
|
|
296
300
|
});
|
|
@@ -316,39 +320,39 @@ function z({ onClick: r = () => {
|
|
|
316
320
|
"md:flex-row md:items-center md:w-auto md:h-[34px] md:leading-[34px] md:gap-6",
|
|
317
321
|
"order-2 md:order-0"
|
|
318
322
|
),
|
|
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:
|
|
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: t, className: "h-full flex items-center justify-start", baseUrl: h.baseUrl, suppressHydrationWarning: !0, children: h.label }) }, O))
|
|
320
324
|
}
|
|
321
325
|
),
|
|
322
|
-
/* @__PURE__ */ e(ie, { onClick:
|
|
326
|
+
/* @__PURE__ */ e(ie, { onClick: t }),
|
|
323
327
|
!g.includes("/login") && !l ? /* @__PURE__ */ s(A, { children: [
|
|
324
|
-
/* @__PURE__ */ e(oe, { onClick:
|
|
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:
|
|
328
|
+
/* @__PURE__ */ e(oe, { onClick: t, userInfo: c }),
|
|
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: 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" })
|
|
326
330
|
] }) : null
|
|
327
331
|
]
|
|
328
332
|
}
|
|
329
333
|
);
|
|
330
334
|
}
|
|
331
|
-
function me({ hideLogin:
|
|
335
|
+
function me({ hideLogin: t, hideNews: r }) {
|
|
332
336
|
const [l, n] = N(!1);
|
|
333
337
|
if (!l)
|
|
334
|
-
return /* @__PURE__ */ e(
|
|
338
|
+
return /* @__PURE__ */ e(te, { onClick: () => n(!0), size: 32, style: { color: "var(--title)" }, className: "md:hidden ml-2.5 bg-module rounded-lg p-[4px] " });
|
|
335
339
|
const a = (o) => {
|
|
336
340
|
o == null || o.preventDefault(), o == null || o.stopPropagation(), n(!1);
|
|
337
341
|
};
|
|
338
|
-
return /* @__PURE__ */ e(
|
|
342
|
+
return /* @__PURE__ */ e(re, { 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: [
|
|
339
343
|
/* @__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) }) }),
|
|
340
|
-
/* @__PURE__ */ e(z, { onClick: (o) => a(o), hideLogin:
|
|
344
|
+
/* @__PURE__ */ e(z, { onClick: (o) => a(o), hideLogin: t, hideNews: r })
|
|
341
345
|
] }) });
|
|
342
346
|
}
|
|
343
|
-
function ue({ hideNews:
|
|
347
|
+
function ue({ hideNews: t, hideLogin: r }) {
|
|
344
348
|
return /* @__PURE__ */ s("div", { className: "flex justify-end items-center md:gap-10 z-1001 ", children: [
|
|
345
|
-
/* @__PURE__ */ e(me, { hideLogin:
|
|
346
|
-
/* @__PURE__ */ e("div", { className: "hidden md:block", children: /* @__PURE__ */ e(z, { hideNews:
|
|
349
|
+
/* @__PURE__ */ e(me, { hideLogin: r, hideNews: t }),
|
|
350
|
+
/* @__PURE__ */ e("div", { className: "hidden md:block", children: /* @__PURE__ */ e(z, { hideNews: t, hideLogin: r }) })
|
|
347
351
|
] });
|
|
348
352
|
}
|
|
349
353
|
function he() {
|
|
350
|
-
const { resolvedTheme:
|
|
351
|
-
return /* @__PURE__ */ e(p, { suppressHydrationWarning: !0, href: `/?theme=${
|
|
354
|
+
const { resolvedTheme: t, theme: r } = f();
|
|
355
|
+
return /* @__PURE__ */ e(p, { suppressHydrationWarning: !0, href: `/?theme=${t || r}`, baseUrl: process.env.NEXT_PUBLIC_ICHAINGO_SEARCH_BASEURL, className: d(
|
|
352
356
|
"w-auto shrink-0 block"
|
|
353
357
|
), children: /* @__PURE__ */ e(
|
|
354
358
|
S,
|
|
@@ -362,16 +366,16 @@ function he() {
|
|
|
362
366
|
}
|
|
363
367
|
) });
|
|
364
368
|
}
|
|
365
|
-
function Be({ extra:
|
|
369
|
+
function Be({ extra: t, children: r, className: l, hideNews: n, hideLogin: a }) {
|
|
366
370
|
return /* @__PURE__ */ s("div", { className: d("sticky left-0 right-0 top-0 bg-background h-16 z-999", l), children: [
|
|
367
371
|
/* @__PURE__ */ s("div", { className: "md:bg-module h-13 text-center flex flex-wrap justify-between items-center gap-2 px-4", children: [
|
|
368
372
|
/* @__PURE__ */ s("div", { className: "flex items-center flex-1 gap-6", children: [
|
|
369
373
|
/* @__PURE__ */ e(he, {}),
|
|
370
|
-
|
|
374
|
+
r
|
|
371
375
|
] }),
|
|
372
376
|
/* @__PURE__ */ e(ue, { hideNews: n, hideLogin: a })
|
|
373
377
|
] }),
|
|
374
|
-
|
|
378
|
+
t
|
|
375
379
|
] });
|
|
376
380
|
}
|
|
377
381
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ichaingo/header",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
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/auth": "1.2.
|
|
33
|
-
"@ichaingo/
|
|
34
|
-
"@ichaingo/
|
|
35
|
-
"@ichaingo/
|
|
36
|
-
"@ichaingo/link": "1.2.
|
|
37
|
-
"@ichaingo/translation": "1.2.
|
|
38
|
-
"@ichaingo/
|
|
39
|
-
"@ichaingo/
|
|
40
|
-
"@ichaingo/
|
|
41
|
-
"@ichaingo/ui": "1.2.
|
|
32
|
+
"@ichaingo/auth": "1.2.2",
|
|
33
|
+
"@ichaingo/avatar": "1.2.2",
|
|
34
|
+
"@ichaingo/image": "1.2.2",
|
|
35
|
+
"@ichaingo/better-link": "1.2.2",
|
|
36
|
+
"@ichaingo/link": "1.2.2",
|
|
37
|
+
"@ichaingo/translation": "1.2.2",
|
|
38
|
+
"@ichaingo/i18n": "1.2.2",
|
|
39
|
+
"@ichaingo/theme-toggle": "1.2.2",
|
|
40
|
+
"@ichaingo/providers": "1.2.2",
|
|
41
|
+
"@ichaingo/ui": "1.2.2"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/js-cookie": "^3.0.6"
|