@ichaingo/header 1.5.19 → 1.5.21
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/Explorer.js +9 -9
- package/dist/lib/Nav.js +33 -31
- package/package.json +14 -14
package/dist/lib/Explorer.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as o, jsxs as
|
|
3
|
-
import
|
|
2
|
+
import { jsx as o, jsxs as p } from "react/jsx-runtime";
|
|
3
|
+
import i from "@ichaingo/translation";
|
|
4
4
|
import { Dropdown as h } from "antd";
|
|
5
|
-
import { useState as f, useEffect as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
5
|
+
import { useState as f, useEffect as u } from "react";
|
|
6
|
+
import d from "@ichaingo/request";
|
|
7
|
+
import m from "@ichaingo/link";
|
|
8
8
|
import g from "@ichaingo/better-link";
|
|
9
9
|
import w from "@ichaingo/image";
|
|
10
10
|
function I() {
|
|
11
11
|
const { gotoExplorer: n } = g(), [t, s] = f([]), c = async () => {
|
|
12
|
-
const r = await
|
|
12
|
+
const r = await d.get("/api/v2/chains/all-chain-list/basic");
|
|
13
13
|
s(r.data);
|
|
14
14
|
};
|
|
15
|
-
|
|
15
|
+
u(() => {
|
|
16
16
|
c();
|
|
17
17
|
}, []);
|
|
18
18
|
const l = (r) => {
|
|
19
19
|
var a, e;
|
|
20
|
-
return /* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */ p(m, { href: n({ chain: r.chainSymbol }), className: "w-full h-full flex items-center gap-2 py-2 cursor-pointer font-medium", baseUrl: process.env.NEXT_PUBLIC_BASE_URL, children: [
|
|
21
21
|
/* @__PURE__ */ o(w, { src: r != null && r.chainIconUrl ? r == null ? void 0 : r.chainIconUrl : `//cdn.ichaingo.com/module/cryptos/${(e = (a = r == null ? void 0 : r.chain) == null ? void 0 : a.toLowerCase()) == null ? void 0 : e.replace(" ", "-")}.png?format=auto&width=20&height=20`, className: "w-5 h-5", objectFit: "contain" }),
|
|
22
22
|
/* @__PURE__ */ o("div", { className: "flex-1", children: r == null ? void 0 : r.chainSymbol })
|
|
23
23
|
] });
|
|
@@ -37,7 +37,7 @@ function I() {
|
|
|
37
37
|
key: r.chainSymbol
|
|
38
38
|
}))
|
|
39
39
|
},
|
|
40
|
-
children: /* @__PURE__ */ o("div", { className: "whitespace-nowrap
|
|
40
|
+
children: /* @__PURE__ */ o("div", { className: "whitespace-nowrap flex items-center gap-1 rounded-lg", children: /* @__PURE__ */ o(i, { value: "title", parentKey: "browser" }) })
|
|
41
41
|
}
|
|
42
42
|
);
|
|
43
43
|
}
|
package/dist/lib/Nav.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as r, jsxs as
|
|
2
|
+
import { jsx as r, jsxs as m, 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 d from "@ichaingo/translation";
|
|
7
|
+
import { twMerge as a } 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
|
-
import { useState as
|
|
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";
|
|
14
|
-
import { onUserEvent as
|
|
15
|
-
import { usePathname as
|
|
14
|
+
import { onUserEvent as j, cleanUserEvent as A, USER_EVENTS as f } from "./events.js";
|
|
15
|
+
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 = S(), l =
|
|
19
|
+
const { gotoAISQL: U, gotoChat: w } = N(), t = S(), 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 }),
|
|
23
23
|
key: `/${t}`,
|
|
24
|
-
label: /* @__PURE__ */ r("span", {
|
|
24
|
+
label: /* @__PURE__ */ r("span", { children: "iSearch" }),
|
|
25
25
|
show: (e) => e === `/${t}` || e.includes(`/${t}/conversation`)
|
|
26
26
|
},
|
|
27
27
|
{
|
|
@@ -38,38 +38,40 @@ function Y({ onClick: s = () => {
|
|
|
38
38
|
label: /* @__PURE__ */ r(C, {}),
|
|
39
39
|
show: (e) => e.includes("/explorer")
|
|
40
40
|
},
|
|
41
|
-
{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
// {
|
|
42
|
+
// baseUrl: process.env.NEXT_PUBLIC_BASE_URL,
|
|
43
|
+
// href: `/etf/btc-us`,
|
|
44
|
+
// key: '/etf',
|
|
45
|
+
// label: <Translation value="etf" parentKey="menu" />,
|
|
46
|
+
// show: (pathname: string) => {
|
|
47
|
+
// return pathname.includes(`/etf`)
|
|
48
|
+
// }
|
|
49
|
+
// },
|
|
48
50
|
{
|
|
49
51
|
baseUrl: process.env.NEXT_PUBLIC_BASE_URL,
|
|
50
52
|
href: "/news",
|
|
51
53
|
key: "/news",
|
|
52
|
-
label: /* @__PURE__ */ r(
|
|
54
|
+
label: /* @__PURE__ */ r(d, { value: "news", parentKey: "menu" }),
|
|
53
55
|
show: (e) => e.includes("/news")
|
|
54
56
|
},
|
|
55
57
|
{
|
|
56
58
|
baseUrl: process.env.NEXT_PUBLIC_BASE_URL,
|
|
57
59
|
href: "/ranking/token",
|
|
58
60
|
key: "/ranking",
|
|
59
|
-
label: /* @__PURE__ */ r(
|
|
61
|
+
label: /* @__PURE__ */ r(d, { value: "ranking", parentKey: "menu" }),
|
|
60
62
|
show: (e) => e.includes("/ranking")
|
|
61
63
|
}
|
|
62
|
-
].filter((e) => c ? !["/explorer", "/chat", "/sql"].includes(e.key) : !0),
|
|
63
|
-
I().then((
|
|
64
|
-
b(
|
|
64
|
+
].filter((e) => c ? !["/explorer", "/chat", "/sql"].includes(e.key) : !0), i = P(() => new Promise((e) => {
|
|
65
|
+
I().then((n) => {
|
|
66
|
+
b(n), g((/* @__PURE__ */ new Date()).getTime().toString()), e(n);
|
|
65
67
|
});
|
|
66
68
|
}), []);
|
|
67
|
-
return
|
|
68
|
-
|
|
69
|
-
}), []), /* @__PURE__ */
|
|
69
|
+
return B(() => (j(f.PROFILE_UPDATED, i), () => {
|
|
70
|
+
A(f.PROFILE_UPDATED, i);
|
|
71
|
+
}), []), /* @__PURE__ */ m(
|
|
70
72
|
"nav",
|
|
71
73
|
{
|
|
72
|
-
className:
|
|
74
|
+
className: a(
|
|
73
75
|
"flex flex-col justify-start items-start md:px-3",
|
|
74
76
|
"md:flex-row md:justify-end md:items-center md:px-0",
|
|
75
77
|
"md:gap-6"
|
|
@@ -78,18 +80,18 @@ function Y({ onClick: s = () => {
|
|
|
78
80
|
/* @__PURE__ */ r(
|
|
79
81
|
"ul",
|
|
80
82
|
{
|
|
81
|
-
className:
|
|
82
|
-
"flex flex-col justify-start items-start w-full h-full text-sm
|
|
83
|
-
"md:flex-row md:items-center md:w-auto md:h-[34px]
|
|
83
|
+
className: a(
|
|
84
|
+
"flex flex-col justify-start items-start w-full h-full text-sm z-1001 text-title",
|
|
85
|
+
"md:flex-row md:items-center md:w-auto md:h-[34px] md:gap-6",
|
|
84
86
|
"order-2 md:order-0"
|
|
85
87
|
),
|
|
86
|
-
children: y.map((e,
|
|
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-subtitle"), 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))
|
|
87
89
|
}
|
|
88
90
|
),
|
|
89
91
|
/* @__PURE__ */ r(v, { onClick: s }),
|
|
90
|
-
!l.includes("/login") && !p ? /* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */ r(_, { onClick: s, userInfo:
|
|
92
|
-
|
|
92
|
+
!l.includes("/login") && !p ? /* @__PURE__ */ m(E, { children: [
|
|
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(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" })
|
|
93
95
|
] }) : null
|
|
94
96
|
]
|
|
95
97
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ichaingo/header",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.21",
|
|
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/better-link": "1.5.
|
|
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.21",
|
|
36
|
+
"@ichaingo/image": "1.5.21",
|
|
37
|
+
"@ichaingo/better-link": "1.5.21",
|
|
38
|
+
"@ichaingo/translation": "1.5.21",
|
|
39
|
+
"@ichaingo/ui": "1.5.21",
|
|
40
|
+
"@ichaingo/request": "1.5.21",
|
|
41
|
+
"@ichaingo/with-login": "1.5.21",
|
|
42
|
+
"@ichaingo/tooltip": "1.5.21",
|
|
43
|
+
"@ichaingo/iconfont": "1.5.21",
|
|
44
|
+
"@ichaingo/token": "1.5.21",
|
|
45
|
+
"@ichaingo/avatar": "1.5.21",
|
|
46
|
+
"@ichaingo/theme-toggle": "1.5.21",
|
|
47
|
+
"@ichaingo/link": "1.5.21"
|
|
48
48
|
}
|
|
49
49
|
}
|