@ichaingo/header 1.3.85 → 1.3.86
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.
|
@@ -1,103 +1,103 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as e, jsxs as
|
|
2
|
+
import { jsx as e, jsxs as a, Fragment as T } from "react/jsx-runtime";
|
|
3
3
|
import h from "@ichaingo/link";
|
|
4
|
-
import { DropdownMenu as
|
|
4
|
+
import { DropdownMenu as M, DropdownMenuTrigger as X, DropdownMenuContent as $, DropdownMenuGroup as O, DropdownMenuItem as G } from "@ichaingo/ui/dropdown-menu";
|
|
5
5
|
import d from "@ichaingo/translation";
|
|
6
|
-
import { useState as
|
|
7
|
-
import
|
|
8
|
-
import { useLocale as
|
|
9
|
-
import
|
|
10
|
-
import { logout as
|
|
6
|
+
import { useState as f, useMemo as F, useEffect as N, useCallback as y } from "react";
|
|
7
|
+
import U from "@ichaingo/better-link";
|
|
8
|
+
import { useLocale as w, useTranslations as _ } from "next-intl";
|
|
9
|
+
import k from "@ichaingo/avatar";
|
|
10
|
+
import { logout as q, fetchUserProfile as Q } from "@ichaingo/auth";
|
|
11
11
|
import { twMerge as m } from "tailwind-merge";
|
|
12
|
-
import { Accordion as
|
|
13
|
-
import
|
|
14
|
-
import { Popover as
|
|
15
|
-
import { PopoverArrow as
|
|
16
|
-
import { useSearchParams as
|
|
17
|
-
import
|
|
18
|
-
import { o as
|
|
19
|
-
import
|
|
20
|
-
import { Menu as
|
|
21
|
-
function
|
|
22
|
-
userInfo:
|
|
12
|
+
import { Accordion as P, AccordionItem as j, AccordionTrigger as S, AccordionContent as R } from "@ichaingo/ui/accordion";
|
|
13
|
+
import V from "@ichaingo/iconfont";
|
|
14
|
+
import { Popover as W, PopoverTrigger as J, PopoverContent as Y } from "@ichaingo/ui/popover";
|
|
15
|
+
import { PopoverArrow as Z } from "@radix-ui/react-popover";
|
|
16
|
+
import { useSearchParams as I, usePathname as B } from "next/navigation";
|
|
17
|
+
import ee from "@ichaingo/theme-toggle";
|
|
18
|
+
import { o as re, c as le, U as A } from "./index-fEXJB_xG.js";
|
|
19
|
+
import te from "rc-drawer";
|
|
20
|
+
import { Menu as ne, X as ae } from "lucide-react";
|
|
21
|
+
function se({
|
|
22
|
+
userInfo: l
|
|
23
23
|
}) {
|
|
24
|
-
const { gotoLogin:
|
|
25
|
-
return
|
|
26
|
-
t(
|
|
24
|
+
const { gotoLogin: r } = U(), [n, t] = f(""), i = w(), o = F(() => l == null ? void 0 : l.id, [l]);
|
|
25
|
+
return N(() => {
|
|
26
|
+
t(r({
|
|
27
27
|
locale: i,
|
|
28
28
|
redirect: window.location.href
|
|
29
29
|
}));
|
|
30
|
-
}, [i,
|
|
30
|
+
}, [i, r]), o ? (
|
|
31
31
|
// userInfo?.profileUrl
|
|
32
32
|
// https://images.ichaingo.com/user-profile/100000201.png
|
|
33
|
-
/* @__PURE__ */ e(
|
|
33
|
+
/* @__PURE__ */ e(k, { userInfo: l, className: "w-8 h-8" })
|
|
34
34
|
) : /* @__PURE__ */ e(
|
|
35
35
|
h,
|
|
36
36
|
{
|
|
37
|
-
href:
|
|
37
|
+
href: n,
|
|
38
38
|
className: "cursor-pointer text-sm text-white bg-primary py-2 px-3 rounded-lg",
|
|
39
39
|
replace: !0,
|
|
40
40
|
children: /* @__PURE__ */ e(d, { value: "signIn", parentKey: "account" })
|
|
41
41
|
}
|
|
42
42
|
);
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
const
|
|
46
|
-
await
|
|
44
|
+
function H({ className: l }) {
|
|
45
|
+
const r = y(async () => {
|
|
46
|
+
await q();
|
|
47
47
|
}, []);
|
|
48
48
|
return /* @__PURE__ */ e(
|
|
49
49
|
"button",
|
|
50
50
|
{
|
|
51
|
-
onClick:
|
|
52
|
-
className: m("cursor-pointer relative",
|
|
51
|
+
onClick: r,
|
|
52
|
+
className: m("cursor-pointer relative", l),
|
|
53
53
|
children: /* @__PURE__ */ e(d, { value: "logout", parentKey: "account" })
|
|
54
54
|
}
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
list:
|
|
59
|
-
userInfo:
|
|
60
|
-
onClick:
|
|
57
|
+
function ie({
|
|
58
|
+
list: l,
|
|
59
|
+
userInfo: r,
|
|
60
|
+
onClick: n
|
|
61
61
|
}) {
|
|
62
|
-
return /* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */ e(
|
|
64
|
-
/* @__PURE__ */ e(
|
|
65
|
-
/* @__PURE__ */ e("div", { className: "flex flex-col gap-3 w-full bg-background rounded-lg p-2", children: /* @__PURE__ */
|
|
66
|
-
/* @__PURE__ */ e(
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
/* @__PURE__ */ e("div", { className: "text-sm font-medium", children: (
|
|
69
|
-
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground w-full truncate", children: (
|
|
62
|
+
return /* @__PURE__ */ a(M, { children: [
|
|
63
|
+
/* @__PURE__ */ e(X, { className: "outline-none cursor-pointer", children: /* @__PURE__ */ e(se, { userInfo: r }) }),
|
|
64
|
+
/* @__PURE__ */ e($, { align: "end", className: "z-2000 w-75 p-0 border-transparent outline-none border border-stroke", children: /* @__PURE__ */ a(O, { className: "flex flex-col gap-2 p-3 bg-module rounded-md", children: [
|
|
65
|
+
/* @__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: [
|
|
66
|
+
/* @__PURE__ */ e(k, { userInfo: r, className: "w-8 h-8" }),
|
|
67
|
+
/* @__PURE__ */ a("div", { className: "flex flex-col overflow-hidden", children: [
|
|
68
|
+
/* @__PURE__ */ e("div", { className: "text-sm font-medium", children: (r == null ? void 0 : r.username) || "--" }),
|
|
69
|
+
/* @__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) })
|
|
70
70
|
] })
|
|
71
71
|
] }) }),
|
|
72
|
-
|
|
72
|
+
l.map((t) => /* @__PURE__ */ e(G, { 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: t.name === "logout" ? /* @__PURE__ */ e(H, { className: "flex-1 flex py-3 border-t border-stroke w-full px-2 hover:bg-background" }) : /* @__PURE__ */ e(h, { href: `/${t.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(d, { value: t.name, parentKey: "account" }) }) }) }, t.name))
|
|
73
73
|
] }) })
|
|
74
74
|
] });
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
list:
|
|
78
|
-
userInfo:
|
|
79
|
-
onClick:
|
|
76
|
+
function oe({
|
|
77
|
+
list: l,
|
|
78
|
+
userInfo: r,
|
|
79
|
+
onClick: n
|
|
80
80
|
}) {
|
|
81
81
|
return /* @__PURE__ */ e(
|
|
82
|
-
|
|
82
|
+
P,
|
|
83
83
|
{
|
|
84
84
|
type: "single",
|
|
85
85
|
collapsible: !0,
|
|
86
86
|
className: "w-full",
|
|
87
87
|
defaultValue: "",
|
|
88
|
-
children: /* @__PURE__ */
|
|
89
|
-
/* @__PURE__ */ e(
|
|
90
|
-
/* @__PURE__ */ e(
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */ e("div", { className: "text-sm font-medium", children:
|
|
93
|
-
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground w-full truncate", children: (
|
|
88
|
+
children: /* @__PURE__ */ a(j, { value: "item-1", className: "p-0 w-full border border-none", children: [
|
|
89
|
+
/* @__PURE__ */ e(S, { 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: [
|
|
90
|
+
/* @__PURE__ */ e(k, { userInfo: r, className: "w-8 h-8 shrink-0" }),
|
|
91
|
+
/* @__PURE__ */ a("div", { className: "flex flex-col overflow-hidden", children: [
|
|
92
|
+
/* @__PURE__ */ e("div", { className: "text-sm font-medium", children: r == null ? void 0 : r.username }),
|
|
93
|
+
/* @__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) })
|
|
94
94
|
] })
|
|
95
95
|
] }) }) }),
|
|
96
|
-
/* @__PURE__ */ e(
|
|
96
|
+
/* @__PURE__ */ e(R, { className: "flex text-sm flex-col text-balance bg-background rounded-lg p-3 gap-3 mt-[10px]", children: /* @__PURE__ */ e("dl", { children: l.map((t) => /* @__PURE__ */ e(
|
|
97
97
|
"dd",
|
|
98
98
|
{
|
|
99
99
|
className: "flex justify-start items-center gap-2 py-2",
|
|
100
|
-
children: /* @__PURE__ */ e(h, { href: `/${t.href}`, className: "flex-1 py-2", onClick:
|
|
100
|
+
children: /* @__PURE__ */ e(h, { href: `/${t.href}`, className: "flex-1 py-2", onClick: n, suppressHydrationWarning: !0, baseUrl: process.env.NEXT_PUBLIC_AUTH_URL, children: /* @__PURE__ */ e(d, { value: t.name, parentKey: "account" }) })
|
|
101
101
|
},
|
|
102
102
|
t.name
|
|
103
103
|
)) }) })
|
|
@@ -105,30 +105,30 @@ function se({
|
|
|
105
105
|
}
|
|
106
106
|
);
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
}, className:
|
|
110
|
-
const
|
|
111
|
-
return
|
|
108
|
+
function D({ onClick: l = () => {
|
|
109
|
+
}, className: r }) {
|
|
110
|
+
const n = w(), { gotoLogin: t } = U(), [i, o] = f("");
|
|
111
|
+
return N(() => {
|
|
112
112
|
o(t({
|
|
113
|
-
locale:
|
|
113
|
+
locale: n,
|
|
114
114
|
redirect: window.location.href
|
|
115
115
|
}));
|
|
116
|
-
}, [
|
|
116
|
+
}, [n, t]), /* @__PURE__ */ e(
|
|
117
117
|
h,
|
|
118
118
|
{
|
|
119
119
|
href: i,
|
|
120
|
-
onClick:
|
|
120
|
+
onClick: l,
|
|
121
121
|
baseUrl: process.env.NEXT_PUBLIC_AUTH_URL,
|
|
122
122
|
replace: !0,
|
|
123
123
|
className: m(
|
|
124
124
|
"cursor-pointer text-sm text-white bg-primary py-2 px-3 rounded-lg",
|
|
125
|
-
|
|
125
|
+
r
|
|
126
126
|
),
|
|
127
127
|
children: /* @__PURE__ */ e(d, { value: "signIn", parentKey: "account" })
|
|
128
128
|
}
|
|
129
129
|
);
|
|
130
130
|
}
|
|
131
|
-
const
|
|
131
|
+
const C = [
|
|
132
132
|
{
|
|
133
133
|
name: "overview",
|
|
134
134
|
href: "user-center"
|
|
@@ -150,83 +150,83 @@ const _ = [
|
|
|
150
150
|
href: void 0
|
|
151
151
|
}
|
|
152
152
|
];
|
|
153
|
-
function
|
|
154
|
-
}, className:
|
|
155
|
-
return
|
|
156
|
-
/* @__PURE__ */ e("div", { className: m("hidden md:flex items-center",
|
|
157
|
-
/* @__PURE__ */ e("div", { className: m("block md:hidden w-full",
|
|
158
|
-
] }) : /* @__PURE__ */ e(
|
|
153
|
+
function ce({ onClick: l = (t) => {
|
|
154
|
+
}, className: r, userInfo: n }) {
|
|
155
|
+
return n != null && n.id ? /* @__PURE__ */ a(T, { children: [
|
|
156
|
+
/* @__PURE__ */ e("div", { className: m("hidden md:flex items-center", r), children: /* @__PURE__ */ e(ie, { list: C, userInfo: n, onClick: l }) }),
|
|
157
|
+
/* @__PURE__ */ e("div", { className: m("block md:hidden w-full", r), children: /* @__PURE__ */ e(oe, { list: C.filter((t) => t.href), userInfo: n, onClick: l }) })
|
|
158
|
+
] }) : /* @__PURE__ */ e(D, { onClick: l, className: m(
|
|
159
159
|
"hidden md:flex cursor-pointer text-sm text-white bg-primary py-2 px-3 rounded-lg",
|
|
160
160
|
"order-3"
|
|
161
161
|
) });
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function E({ onClick: l = () => {
|
|
164
164
|
} }) {
|
|
165
|
-
var
|
|
166
|
-
const
|
|
165
|
+
var x;
|
|
166
|
+
const r = w(), n = I(), t = _("lang"), i = _("setting"), o = [
|
|
167
167
|
{ name: t("en"), lang: "en" },
|
|
168
168
|
{ name: t("zh-hant"), lang: "zh-hant" },
|
|
169
169
|
{ name: t("zh-hans"), lang: "zh-hans" },
|
|
170
170
|
{ name: t("ja"), lang: "ja" },
|
|
171
171
|
{ name: t("ko"), lang: "ko" }
|
|
172
|
-
], s =
|
|
172
|
+
], s = B(), g = y(
|
|
173
173
|
(c) => {
|
|
174
|
-
const
|
|
175
|
-
return
|
|
174
|
+
const u = s.replace(new RegExp(`/${r}(/|$)`), `/${c}$1`), b = n.toString();
|
|
175
|
+
return b ? `${u}?${b}` : u;
|
|
176
176
|
},
|
|
177
|
-
[s,
|
|
177
|
+
[s, r, n]
|
|
178
178
|
);
|
|
179
|
-
return /* @__PURE__ */
|
|
180
|
-
/* @__PURE__ */ e("div", { className: "flex w-full justify-between items-center", children: /* @__PURE__ */ e(
|
|
181
|
-
/* @__PURE__ */ e(
|
|
179
|
+
return /* @__PURE__ */ a("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__ */ a(j, { value: r, className: "border-0", children: [
|
|
181
|
+
/* @__PURE__ */ e(S, { 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: [
|
|
182
182
|
/* @__PURE__ */ e("span", { className: "text-title", children: i("language") }),
|
|
183
|
-
/* @__PURE__ */ e("span", { className: "text-title", children: (
|
|
183
|
+
/* @__PURE__ */ e("span", { className: "text-title", children: (x = o.find((c) => c.lang === r)) == null ? void 0 : x.name })
|
|
184
184
|
] }) }),
|
|
185
|
-
/* @__PURE__ */ e(
|
|
185
|
+
/* @__PURE__ */ e(R, { className: "bg-background mt-3 rounded-lg flex flex-col gap-2", children: o.map((c) => /* @__PURE__ */ e(
|
|
186
186
|
h,
|
|
187
187
|
{
|
|
188
188
|
prefetch: !1,
|
|
189
189
|
withLocale: !1,
|
|
190
190
|
className: m(
|
|
191
191
|
"p-2 rounded-lg flex w-full justify-between items-center",
|
|
192
|
-
|
|
192
|
+
r === c.lang ? "text-primary" : ""
|
|
193
193
|
),
|
|
194
194
|
href: g(c.lang),
|
|
195
|
-
onClick:
|
|
195
|
+
onClick: l,
|
|
196
196
|
children: c.name
|
|
197
197
|
},
|
|
198
198
|
c.lang
|
|
199
199
|
)) })
|
|
200
200
|
] }) }) }),
|
|
201
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ a("div", { className: "bg-background p-2 rounded-lg h-11 md:h-auto flex w-full justify-between items-center", children: [
|
|
202
202
|
/* @__PURE__ */ e("div", { children: i("theme") }),
|
|
203
|
-
/* @__PURE__ */ e(
|
|
203
|
+
/* @__PURE__ */ e(ee, {})
|
|
204
204
|
] })
|
|
205
205
|
] });
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function de({ onClick: l = () => {
|
|
208
208
|
} }) {
|
|
209
|
-
return /* @__PURE__ */
|
|
210
|
-
/* @__PURE__ */ e("div", { className: "hidden md:flex items-center bg-module rounded-lg p-1.5 cursor-pointer", children: /* @__PURE__ */
|
|
211
|
-
/* @__PURE__ */ e(
|
|
212
|
-
/* @__PURE__ */
|
|
213
|
-
|
|
209
|
+
return /* @__PURE__ */ a("div", { className: "w-full md:w-auto order-3 md:order-0", children: [
|
|
210
|
+
/* @__PURE__ */ e("div", { className: "hidden md:flex items-center bg-module rounded-lg p-1.5 cursor-pointer", children: /* @__PURE__ */ a(W, { children: [
|
|
211
|
+
/* @__PURE__ */ e(J, { asChild: !0, children: /* @__PURE__ */ e(V, { type: "icon-setting", className: "text-2xl" }) }),
|
|
212
|
+
/* @__PURE__ */ a(
|
|
213
|
+
Y,
|
|
214
214
|
{
|
|
215
215
|
side: "bottom",
|
|
216
216
|
className: "relative top-[10px] rounded-xl border border-stroke bg-module p-2 w-72 z-1000",
|
|
217
217
|
children: [
|
|
218
|
-
/* @__PURE__ */ e(
|
|
219
|
-
/* @__PURE__ */ e(
|
|
218
|
+
/* @__PURE__ */ e(Z, { className: "fill-module" }),
|
|
219
|
+
/* @__PURE__ */ e(E, { onClick: l })
|
|
220
220
|
]
|
|
221
221
|
}
|
|
222
222
|
)
|
|
223
223
|
] }) }),
|
|
224
|
-
/* @__PURE__ */ e("div", { className: "md:hidden", children: /* @__PURE__ */ e(
|
|
224
|
+
/* @__PURE__ */ e("div", { className: "md:hidden", children: /* @__PURE__ */ e(E, {}) })
|
|
225
225
|
] });
|
|
226
226
|
}
|
|
227
|
-
function
|
|
228
|
-
}, hideNews:
|
|
229
|
-
const { gotoAISQL: i, gotoChat: o } =
|
|
227
|
+
function z({ onClick: l = () => {
|
|
228
|
+
}, hideNews: r = !1, hideLogin: n = !1, user: t }) {
|
|
229
|
+
const { gotoAISQL: i, gotoChat: o } = U(), s = w(), g = B(), [x, c] = f(""), [u, b] = f(t), K = [
|
|
230
230
|
{
|
|
231
231
|
baseUrl: process.env.NEXT_PUBLIC_ICHAINGO_SEARCH_BASEURL,
|
|
232
232
|
href: "/explorer",
|
|
@@ -237,7 +237,7 @@ function H({ onClick: r = () => {
|
|
|
237
237
|
baseUrl: process.env.NEXT_PUBLIC_CHAT_URL,
|
|
238
238
|
href: o({ locale: s }),
|
|
239
239
|
key: "/chat",
|
|
240
|
-
label: /* @__PURE__ */
|
|
240
|
+
label: /* @__PURE__ */ a("span", { className: "whitespace-nowrap leading-11 md:leading-[34px]", children: [
|
|
241
241
|
/* @__PURE__ */ e("span", { role: "img", "aria-label": "hot", children: "🔥" }),
|
|
242
242
|
/* @__PURE__ */ e("span", { children: "iGoChat" })
|
|
243
243
|
] })
|
|
@@ -266,14 +266,14 @@ function H({ onClick: r = () => {
|
|
|
266
266
|
key: "/ranking",
|
|
267
267
|
label: /* @__PURE__ */ e(d, { value: "ranking", parentKey: "menu" })
|
|
268
268
|
}
|
|
269
|
-
].filter((p) =>
|
|
270
|
-
|
|
271
|
-
c(p);
|
|
269
|
+
].filter((p) => r ? !["/explorer", "/chat", "/sql"].includes(p.key) : !0), L = y(() => new Promise((p) => {
|
|
270
|
+
Q().then((v) => {
|
|
271
|
+
b(v), c((/* @__PURE__ */ new Date()).getTime().toString()), p(v);
|
|
272
272
|
});
|
|
273
|
-
}, []);
|
|
274
|
-
return
|
|
275
|
-
|
|
276
|
-
}), []), /* @__PURE__ */
|
|
273
|
+
}), []);
|
|
274
|
+
return N(() => (re(A.PROFILE_UPDATED, L), () => {
|
|
275
|
+
le(A.PROFILE_UPDATED, L);
|
|
276
|
+
}), []), /* @__PURE__ */ a(
|
|
277
277
|
"nav",
|
|
278
278
|
{
|
|
279
279
|
className: m(
|
|
@@ -290,36 +290,36 @@ function H({ onClick: r = () => {
|
|
|
290
290
|
"md:flex-row md:items-center md:w-auto md:h-[34px] md:leading-[34px] md:gap-6",
|
|
291
291
|
"order-2 md:order-0"
|
|
292
292
|
),
|
|
293
|
-
children:
|
|
293
|
+
children: K.map((p, v) => /* @__PURE__ */ e("li", { className: m("w-full md:w-auto h-11 md:h-auto cursor-pointer", g.includes(p.key) && "border-b-2 border-primary text-primary "), children: /* @__PURE__ */ e(h, { href: p.href, onClick: l, className: "h-full flex items-center justify-start", baseUrl: p.baseUrl, suppressHydrationWarning: !0, children: p.label }) }, v))
|
|
294
294
|
}
|
|
295
295
|
),
|
|
296
|
-
/* @__PURE__ */ e(
|
|
297
|
-
!g.includes("/login") && !
|
|
298
|
-
/* @__PURE__ */ e(
|
|
299
|
-
u != null && u.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(
|
|
296
|
+
/* @__PURE__ */ e(de, { onClick: l }),
|
|
297
|
+
!g.includes("/login") && !n ? /* @__PURE__ */ a(T, { children: [
|
|
298
|
+
/* @__PURE__ */ e(ce, { onClick: l, userInfo: u }, x),
|
|
299
|
+
u != null && u.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(H, {}) }) : /* @__PURE__ */ e(D, { onClick: l, className: "flex md:hidden h-11 cursor-pointer whitespace-nowrap order-3 bg-primary text-white rounded-lg p-2 mt-3 w-full items-center justify-center" })
|
|
300
300
|
] }) : null
|
|
301
301
|
]
|
|
302
302
|
}
|
|
303
303
|
);
|
|
304
304
|
}
|
|
305
|
-
function
|
|
306
|
-
const [t, i] =
|
|
305
|
+
function me({ hideLogin: l, hideNews: r, user: n }) {
|
|
306
|
+
const [t, i] = f(!1);
|
|
307
307
|
if (!t)
|
|
308
|
-
return /* @__PURE__ */ e(
|
|
308
|
+
return /* @__PURE__ */ e(ne, { onClick: () => i(!0), size: 32, style: { color: "var(--title)" }, className: "md:hidden ml-2.5 bg-module rounded-lg p-[4px] " });
|
|
309
309
|
const o = (s) => {
|
|
310
310
|
s == null || s.preventDefault(), s == null || s.stopPropagation(), i(!1);
|
|
311
311
|
};
|
|
312
|
-
return /* @__PURE__ */ e(
|
|
313
|
-
/* @__PURE__ */ e("div", { className: "flex justify-end items-center p-2", children: /* @__PURE__ */ e(
|
|
314
|
-
/* @__PURE__ */ e(
|
|
312
|
+
return /* @__PURE__ */ e(te, { open: t, 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: [
|
|
313
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end items-center p-2", children: /* @__PURE__ */ e(ae, { size: 24, style: { color: "var(--title)" }, onClick: (s) => o(s) }) }),
|
|
314
|
+
/* @__PURE__ */ e(z, { onClick: (s) => o(s), hideLogin: l, hideNews: r, user: n })
|
|
315
315
|
] }) });
|
|
316
316
|
}
|
|
317
|
-
function
|
|
318
|
-
return /* @__PURE__ */
|
|
319
|
-
/* @__PURE__ */ e(
|
|
320
|
-
/* @__PURE__ */ e("div", { className: "hidden md:block", children: /* @__PURE__ */ e(
|
|
317
|
+
function Pe({ hideNews: l, hideLogin: r, user: n }) {
|
|
318
|
+
return /* @__PURE__ */ a("div", { className: "flex justify-end items-center md:gap-10 z-1001 ", children: [
|
|
319
|
+
/* @__PURE__ */ e(me, { hideLogin: r, hideNews: l, user: n }),
|
|
320
|
+
/* @__PURE__ */ e("div", { className: "hidden md:block", children: /* @__PURE__ */ e(z, { hideNews: l, hideLogin: r, user: n }) })
|
|
321
321
|
] });
|
|
322
322
|
}
|
|
323
323
|
export {
|
|
324
|
-
|
|
324
|
+
Pe as default
|
|
325
325
|
};
|
|
@@ -20,7 +20,7 @@ function h(e, t) {
|
|
|
20
20
|
function U(e, t) {
|
|
21
21
|
window.removeEventListener(e, t);
|
|
22
22
|
}
|
|
23
|
-
const m = c(() => import("./Right-
|
|
23
|
+
const m = c(() => import("./Right-BuaBjbL2.js"), { ssr: !1 }), u = c(() => import("./Logo-BwpYr4IY.js"), { ssr: !1 });
|
|
24
24
|
async function x({ extra: e, children: t, className: s, hideNews: r, hideLogin: i }) {
|
|
25
25
|
let n = {
|
|
26
26
|
data: {}
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
|
|
|
2
2
|
import "tailwind-merge";
|
|
3
3
|
import "@ichaingo/request";
|
|
4
4
|
import "next/dynamic";
|
|
5
|
-
import { U as a, H as i, e as p, o as E } from "./index-
|
|
5
|
+
import { U as a, H as i, e as p, o as E } from "./index-fEXJB_xG.js";
|
|
6
6
|
export {
|
|
7
7
|
a as USER_EVENTS,
|
|
8
8
|
i as default,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ichaingo/header",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.86",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -29,18 +29,18 @@
|
|
|
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/
|
|
38
|
-
"@ichaingo/theme-toggle": "1.3.
|
|
39
|
-
"@ichaingo/providers": "1.3.
|
|
40
|
-
"@ichaingo/
|
|
41
|
-
"@ichaingo/
|
|
42
|
-
"@ichaingo/
|
|
43
|
-
"@ichaingo/iconfont": "1.3.
|
|
32
|
+
"@ichaingo/link": "1.3.86",
|
|
33
|
+
"@ichaingo/image": "1.3.86",
|
|
34
|
+
"@ichaingo/translation": "1.3.86",
|
|
35
|
+
"@ichaingo/ui": "1.3.86",
|
|
36
|
+
"@ichaingo/better-link": "1.3.86",
|
|
37
|
+
"@ichaingo/avatar": "1.3.86",
|
|
38
|
+
"@ichaingo/theme-toggle": "1.3.86",
|
|
39
|
+
"@ichaingo/providers": "1.3.86",
|
|
40
|
+
"@ichaingo/auth": "1.3.86",
|
|
41
|
+
"@ichaingo/i18n": "1.3.86",
|
|
42
|
+
"@ichaingo/request": "1.3.86",
|
|
43
|
+
"@ichaingo/iconfont": "1.3.86"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/js-cookie": "^3.0.6"
|