@ichaingo/header 1.5.21 → 1.5.23
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/lib/Nav.js +12 -12
- package/dist/lib/Setting/index.js +4 -4
- package/package.json +14 -14
package/dist/lib/Nav.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as r, jsxs as
|
|
2
|
+
import { jsx as r, jsxs as i, Fragment as E } from "react/jsx-runtime";
|
|
3
3
|
import L from "@ichaingo/link";
|
|
4
4
|
import _ from "./User/index.js";
|
|
5
5
|
import v from "./Setting/index.js";
|
|
6
6
|
import d from "@ichaingo/translation";
|
|
7
7
|
import { twMerge as a } from "tailwind-merge";
|
|
8
8
|
import N from "@ichaingo/better-link";
|
|
9
|
-
import { useLocale as
|
|
10
|
-
import
|
|
9
|
+
import { useLocale as k } from "next-intl";
|
|
10
|
+
import S from "./User/Logout.js";
|
|
11
11
|
import { useState as u, useCallback as P, useEffect as B } from "react";
|
|
12
12
|
import T from "./User/SignIn.js";
|
|
13
13
|
import { fetchUserProfile as I } from "@ichaingo/auth";
|
|
@@ -16,7 +16,7 @@ import { usePathname as R } from "next/navigation";
|
|
|
16
16
|
import C from "./Explorer.js";
|
|
17
17
|
function Y({ onClick: s = () => {
|
|
18
18
|
}, hideNews: c = !1, hideLogin: p = !1, user: h }) {
|
|
19
|
-
const { gotoAISQL: U, gotoChat: w } = N(), t =
|
|
19
|
+
const { gotoAISQL: U, gotoChat: w } = N(), t = k(), l = R(), [x, g] = u(""), [o, b] = u(h), y = [
|
|
20
20
|
{
|
|
21
21
|
baseUrl: process.env.NEXT_PUBLIC_CHAT_URL,
|
|
22
22
|
href: w({ locale: t }),
|
|
@@ -61,20 +61,20 @@ function Y({ onClick: s = () => {
|
|
|
61
61
|
label: /* @__PURE__ */ r(d, { value: "ranking", parentKey: "menu" }),
|
|
62
62
|
show: (e) => e.includes("/ranking")
|
|
63
63
|
}
|
|
64
|
-
].filter((e) => c ? !["/explorer", "/chat", "/sql"].includes(e.key) : !0),
|
|
64
|
+
].filter((e) => c ? !["/explorer", "/chat", "/sql"].includes(e.key) : !0), m = P(() => new Promise((e) => {
|
|
65
65
|
I().then((n) => {
|
|
66
66
|
b(n), g((/* @__PURE__ */ new Date()).getTime().toString()), e(n);
|
|
67
67
|
});
|
|
68
68
|
}), []);
|
|
69
|
-
return B(() => (j(f.PROFILE_UPDATED,
|
|
70
|
-
A(f.PROFILE_UPDATED,
|
|
71
|
-
}), []), /* @__PURE__ */
|
|
69
|
+
return B(() => (j(f.PROFILE_UPDATED, m), () => {
|
|
70
|
+
A(f.PROFILE_UPDATED, m);
|
|
71
|
+
}), []), /* @__PURE__ */ i(
|
|
72
72
|
"nav",
|
|
73
73
|
{
|
|
74
74
|
className: a(
|
|
75
75
|
"flex flex-col justify-start items-start md:px-3",
|
|
76
76
|
"md:flex-row md:justify-end md:items-center md:px-0",
|
|
77
|
-
"md:gap-
|
|
77
|
+
"md:gap-4"
|
|
78
78
|
),
|
|
79
79
|
children: [
|
|
80
80
|
/* @__PURE__ */ r(
|
|
@@ -85,13 +85,13 @@ function Y({ onClick: s = () => {
|
|
|
85
85
|
"md:flex-row md:items-center md:w-auto md:h-[34px] md:gap-6",
|
|
86
86
|
"order-2 md:order-0"
|
|
87
87
|
),
|
|
88
|
-
children: y.map((e, n) => /* @__PURE__ */ r("li", { className: a("w-full md:px-4 md:py-1 h-11 md:h-auto md:font-bold md:w-auto cursor-pointer md:rounded-full", e.show(l) ? "md:text-primary md:bg-primary/20" : "md:hover:bg-
|
|
88
|
+
children: y.map((e, n) => /* @__PURE__ */ r("li", { className: a("w-full md:px-4 md:py-1 h-11 md:h-auto md:font-bold md:w-auto cursor-pointer md:rounded-full", e.show(l) ? "md:text-primary md:bg-primary/20" : "md:hover:bg-stroke"), children: e.href === l ? e.label : /* @__PURE__ */ r(L, { href: e.href, onClick: s, className: "h-full flex items-center justify-start", baseUrl: e.baseUrl, suppressHydrationWarning: !0, children: e.label }) }, n))
|
|
89
89
|
}
|
|
90
90
|
),
|
|
91
91
|
/* @__PURE__ */ r(v, { onClick: s }),
|
|
92
|
-
!l.includes("/login") && !p ? /* @__PURE__ */
|
|
92
|
+
!l.includes("/login") && !p ? /* @__PURE__ */ i(E, { children: [
|
|
93
93
|
/* @__PURE__ */ r(_, { onClick: s, userInfo: o }, x),
|
|
94
|
-
o != null && o.id ? /* @__PURE__ */ r("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__ */ r(
|
|
94
|
+
o != null && o.id ? /* @__PURE__ */ r("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__ */ r(S, {}) }) : /* @__PURE__ */ r(T, { onClick: s, 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" })
|
|
95
95
|
] }) : null
|
|
96
96
|
]
|
|
97
97
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import d from "@ichaingo/iconfont";
|
|
3
3
|
import i from "@ichaingo/tooltip";
|
|
4
|
-
import
|
|
5
|
-
function a({ onClick:
|
|
4
|
+
import r from "./SettingBody.js";
|
|
5
|
+
function a({ onClick: o = () => {
|
|
6
6
|
} }) {
|
|
7
7
|
return /* @__PURE__ */ t("div", { className: "w-full md:w-auto order-3 md:order-0", children: [
|
|
8
|
-
/* @__PURE__ */ e("div", { className: "hidden md:flex
|
|
9
|
-
/* @__PURE__ */ e("div", { className: "md:hidden", children: /* @__PURE__ */ e(
|
|
8
|
+
/* @__PURE__ */ e("div", { className: "hidden md:flex items-center bg-module hover:bg-stroke rounded-lg p-1.5 cursor-pointer", children: /* @__PURE__ */ e(i, { side: "bottom", needClick: !0, contentClassName: "bg-module w-70 rounded-lg bg-module text-title border border-stroke", trigger: /* @__PURE__ */ e(d, { type: "icon-centersetup", className: "text-2xl" }), arrowClassName: "fill-module", children: /* @__PURE__ */ e(r, { onClick: o }) }) }),
|
|
9
|
+
/* @__PURE__ */ e("div", { className: "md:hidden", children: /* @__PURE__ */ e(r, {}) })
|
|
10
10
|
] });
|
|
11
11
|
}
|
|
12
12
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ichaingo/header",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.23",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -32,18 +32,18 @@
|
|
|
32
32
|
"tailwind-merge": "3.3.1",
|
|
33
33
|
"next": "15.5.6",
|
|
34
34
|
"antd": "6.1.1",
|
|
35
|
-
"@ichaingo/auth": "1.5.
|
|
36
|
-
"@ichaingo/
|
|
37
|
-
"@ichaingo/
|
|
38
|
-
"@ichaingo/
|
|
39
|
-
"@ichaingo/ui": "1.5.
|
|
40
|
-
"@ichaingo/
|
|
41
|
-
"@ichaingo/
|
|
42
|
-
"@ichaingo/
|
|
43
|
-
"@ichaingo/iconfont": "1.5.
|
|
44
|
-
"@ichaingo/
|
|
45
|
-
"@ichaingo/
|
|
46
|
-
"@ichaingo/
|
|
47
|
-
"@ichaingo/
|
|
35
|
+
"@ichaingo/auth": "1.5.23",
|
|
36
|
+
"@ichaingo/better-link": "1.5.23",
|
|
37
|
+
"@ichaingo/avatar": "1.5.23",
|
|
38
|
+
"@ichaingo/image": "1.5.23",
|
|
39
|
+
"@ichaingo/ui": "1.5.23",
|
|
40
|
+
"@ichaingo/translation": "1.5.23",
|
|
41
|
+
"@ichaingo/link": "1.5.23",
|
|
42
|
+
"@ichaingo/with-login": "1.5.23",
|
|
43
|
+
"@ichaingo/iconfont": "1.5.23",
|
|
44
|
+
"@ichaingo/theme-toggle": "1.5.23",
|
|
45
|
+
"@ichaingo/tooltip": "1.5.23",
|
|
46
|
+
"@ichaingo/token": "1.5.23",
|
|
47
|
+
"@ichaingo/request": "1.5.23"
|
|
48
48
|
}
|
|
49
49
|
}
|