@ichaingo/header 1.5.18 → 1.5.19
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 +24 -27
- package/package.json +14 -14
package/dist/lib/Nav.js
CHANGED
|
@@ -1,37 +1,34 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { jsx as r, jsxs as u, 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
|
-
import
|
|
7
|
-
import { twMerge as
|
|
6
|
+
import a from "@ichaingo/translation";
|
|
7
|
+
import { twMerge as i } from "tailwind-merge";
|
|
8
8
|
import N from "@ichaingo/better-link";
|
|
9
9
|
import { useLocale as S } from "next-intl";
|
|
10
10
|
import k from "./User/Logout.js";
|
|
11
11
|
import { useState as d, useCallback as B, useEffect as P } from "react";
|
|
12
|
-
import
|
|
13
|
-
import { fetchUserProfile as
|
|
14
|
-
import { onUserEvent as A, cleanUserEvent as R, USER_EVENTS as
|
|
12
|
+
import T from "./User/SignIn.js";
|
|
13
|
+
import { fetchUserProfile as I } from "@ichaingo/auth";
|
|
14
|
+
import { onUserEvent as A, cleanUserEvent as R, USER_EVENTS as f } from "./events.js";
|
|
15
15
|
import { usePathname as j } from "next/navigation";
|
|
16
16
|
import C from "./Explorer.js";
|
|
17
17
|
function Y({ onClick: s = () => {
|
|
18
|
-
}, hideNews:
|
|
19
|
-
const { gotoAISQL: U, gotoChat: w } = N(), t = S(),
|
|
18
|
+
}, hideNews: c = !1, hideLogin: p = !1, user: h }) {
|
|
19
|
+
const { gotoAISQL: U, gotoChat: w } = N(), t = S(), l = j(), [x, g] = d(""), [n, b] = d(h), y = [
|
|
20
20
|
{
|
|
21
21
|
baseUrl: process.env.NEXT_PUBLIC_CHAT_URL,
|
|
22
22
|
href: w({ locale: t }),
|
|
23
23
|
key: `/${t}`,
|
|
24
|
-
label: /* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */ r("span", { role: "img", "aria-label": "hot", children: "🔥" }),
|
|
26
|
-
/* @__PURE__ */ r("span", { children: "Search" })
|
|
27
|
-
] }),
|
|
24
|
+
label: /* @__PURE__ */ r("span", { className: "whitespace-nowrap leading-11 md:leading-[34px]", children: /* @__PURE__ */ r("span", { children: "iSearch" }) }),
|
|
28
25
|
show: (e) => e === `/${t}` || e.includes(`/${t}/conversation`)
|
|
29
26
|
},
|
|
30
27
|
{
|
|
31
28
|
baseUrl: process.env.NEXT_PUBLIC_BASE_URL,
|
|
32
29
|
href: U({ locale: t }),
|
|
33
30
|
key: "/sql",
|
|
34
|
-
label: "
|
|
31
|
+
label: "iSQL",
|
|
35
32
|
show: (e) => e.includes(`/${t}/sql`)
|
|
36
33
|
},
|
|
37
34
|
{
|
|
@@ -45,34 +42,34 @@ function Y({ onClick: s = () => {
|
|
|
45
42
|
baseUrl: process.env.NEXT_PUBLIC_BASE_URL,
|
|
46
43
|
href: "/etf/btc-us",
|
|
47
44
|
key: "/etf",
|
|
48
|
-
label: /* @__PURE__ */ r(
|
|
45
|
+
label: /* @__PURE__ */ r(a, { value: "etf", parentKey: "menu" }),
|
|
49
46
|
show: (e) => e.includes("/etf")
|
|
50
47
|
},
|
|
51
48
|
{
|
|
52
49
|
baseUrl: process.env.NEXT_PUBLIC_BASE_URL,
|
|
53
50
|
href: "/news",
|
|
54
51
|
key: "/news",
|
|
55
|
-
label: /* @__PURE__ */ r(
|
|
52
|
+
label: /* @__PURE__ */ r(a, { value: "news", parentKey: "menu" }),
|
|
56
53
|
show: (e) => e.includes("/news")
|
|
57
54
|
},
|
|
58
55
|
{
|
|
59
56
|
baseUrl: process.env.NEXT_PUBLIC_BASE_URL,
|
|
60
57
|
href: "/ranking/token",
|
|
61
58
|
key: "/ranking",
|
|
62
|
-
label: /* @__PURE__ */ r(
|
|
59
|
+
label: /* @__PURE__ */ r(a, { value: "ranking", parentKey: "menu" }),
|
|
63
60
|
show: (e) => e.includes("/ranking")
|
|
64
61
|
}
|
|
65
|
-
].filter((e) =>
|
|
66
|
-
|
|
67
|
-
b(
|
|
62
|
+
].filter((e) => c ? !["/explorer", "/chat", "/sql"].includes(e.key) : !0), m = B(() => new Promise((e) => {
|
|
63
|
+
I().then((o) => {
|
|
64
|
+
b(o), g((/* @__PURE__ */ new Date()).getTime().toString()), e(o);
|
|
68
65
|
});
|
|
69
66
|
}), []);
|
|
70
|
-
return P(() => (A(
|
|
71
|
-
R(
|
|
72
|
-
}), []), /* @__PURE__ */
|
|
67
|
+
return P(() => (A(f.PROFILE_UPDATED, m), () => {
|
|
68
|
+
R(f.PROFILE_UPDATED, m);
|
|
69
|
+
}), []), /* @__PURE__ */ u(
|
|
73
70
|
"nav",
|
|
74
71
|
{
|
|
75
|
-
className:
|
|
72
|
+
className: i(
|
|
76
73
|
"flex flex-col justify-start items-start md:px-3",
|
|
77
74
|
"md:flex-row md:justify-end md:items-center md:px-0",
|
|
78
75
|
"md:gap-6"
|
|
@@ -81,18 +78,18 @@ function Y({ onClick: s = () => {
|
|
|
81
78
|
/* @__PURE__ */ r(
|
|
82
79
|
"ul",
|
|
83
80
|
{
|
|
84
|
-
className:
|
|
81
|
+
className: i(
|
|
85
82
|
"flex flex-col justify-start items-start w-full h-full text-sm leading-[44px] z-1001 text-title",
|
|
86
83
|
"md:flex-row md:items-center md:w-auto md:h-[34px] md:leading-[34px] md:gap-6",
|
|
87
84
|
"order-2 md:order-0"
|
|
88
85
|
),
|
|
89
|
-
children: y.map((e,
|
|
86
|
+
children: y.map((e, o) => /* @__PURE__ */ r("li", { className: i("w-full font-bold md:w-auto h-11 md:h-auto cursor-pointer hover:text-primary hover:bg-gray", e.show(l) && "border-b-2 border-primary text-primary "), 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 }) }, o))
|
|
90
87
|
}
|
|
91
88
|
),
|
|
92
89
|
/* @__PURE__ */ r(v, { onClick: s }),
|
|
93
|
-
!
|
|
90
|
+
!l.includes("/login") && !p ? /* @__PURE__ */ u(E, { children: [
|
|
94
91
|
/* @__PURE__ */ r(_, { onClick: s, userInfo: n }, x),
|
|
95
|
-
n != null && n.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(k, {}) }) : /* @__PURE__ */ r(
|
|
92
|
+
n != null && n.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(k, {}) }) : /* @__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" })
|
|
96
93
|
] }) : null
|
|
97
94
|
]
|
|
98
95
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ichaingo/header",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.19",
|
|
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/
|
|
36
|
-
"@ichaingo/
|
|
37
|
-
"@ichaingo/
|
|
38
|
-
"@ichaingo/
|
|
39
|
-
"@ichaingo/
|
|
40
|
-
"@ichaingo/
|
|
41
|
-
"@ichaingo/
|
|
42
|
-
"@ichaingo/
|
|
43
|
-
"@ichaingo/
|
|
44
|
-
"@ichaingo/
|
|
45
|
-
"@ichaingo/
|
|
46
|
-
"@ichaingo/
|
|
47
|
-
"@ichaingo/
|
|
35
|
+
"@ichaingo/auth": "1.5.19",
|
|
36
|
+
"@ichaingo/avatar": "1.5.19",
|
|
37
|
+
"@ichaingo/better-link": "1.5.19",
|
|
38
|
+
"@ichaingo/link": "1.5.19",
|
|
39
|
+
"@ichaingo/image": "1.5.19",
|
|
40
|
+
"@ichaingo/ui": "1.5.19",
|
|
41
|
+
"@ichaingo/translation": "1.5.19",
|
|
42
|
+
"@ichaingo/theme-toggle": "1.5.19",
|
|
43
|
+
"@ichaingo/request": "1.5.19",
|
|
44
|
+
"@ichaingo/tooltip": "1.5.19",
|
|
45
|
+
"@ichaingo/with-login": "1.5.19",
|
|
46
|
+
"@ichaingo/token": "1.5.19",
|
|
47
|
+
"@ichaingo/iconfont": "1.5.19"
|
|
48
48
|
}
|
|
49
49
|
}
|