@ichaingo/header 1.5.33 → 1.5.34
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 +47 -52
- package/package.json +14 -14
package/dist/lib/Explorer.js
CHANGED
|
@@ -1,39 +1,40 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsxs as a, Fragment as
|
|
3
|
-
import
|
|
4
|
-
import { Dropdown as
|
|
5
|
-
import { useState as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { usePathname as
|
|
11
|
-
import { Accordion as
|
|
12
|
-
function
|
|
2
|
+
import { jsxs as a, Fragment as g, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import d from "@ichaingo/translation";
|
|
4
|
+
import { Dropdown as v } from "antd";
|
|
5
|
+
import { useState as p, useEffect as w } from "react";
|
|
6
|
+
import b from "@ichaingo/request";
|
|
7
|
+
import x from "@ichaingo/link";
|
|
8
|
+
import y from "@ichaingo/better-link";
|
|
9
|
+
import N from "@ichaingo/image";
|
|
10
|
+
import { usePathname as A } from "next/navigation";
|
|
11
|
+
import { Accordion as L, AccordionItem as I, AccordionTrigger as S, AccordionContent as j } from "@ichaingo/ui/accordion";
|
|
12
|
+
function F({ onClick: o = () => {
|
|
13
13
|
} }) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
A();
|
|
15
|
+
const { gotoExplorer: m } = y(), [n, u] = p([]), [f, l] = p(""), h = async () => {
|
|
16
|
+
const e = await b.get("/api/v2/chains/all-chain-list/basic");
|
|
17
|
+
u(e.data);
|
|
17
18
|
};
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
w(() => {
|
|
20
|
+
h();
|
|
20
21
|
}, []);
|
|
21
|
-
const
|
|
22
|
-
var
|
|
22
|
+
const c = (e) => {
|
|
23
|
+
var t, s;
|
|
23
24
|
return /* @__PURE__ */ a(
|
|
24
|
-
|
|
25
|
+
x,
|
|
25
26
|
{
|
|
26
|
-
href:
|
|
27
|
+
href: m({ chain: e.chainSymbol }),
|
|
27
28
|
className: "w-full h-full flex items-center gap-2 py-2 cursor-pointer font-medium",
|
|
28
29
|
baseUrl: process.env.NEXT_PUBLIC_BASE_URL,
|
|
29
|
-
onClick: (
|
|
30
|
-
|
|
30
|
+
onClick: (i) => {
|
|
31
|
+
i.preventDefault(), i.stopPropagation(), o == null || o(), l("");
|
|
31
32
|
},
|
|
32
33
|
children: [
|
|
33
34
|
/* @__PURE__ */ r(
|
|
34
|
-
|
|
35
|
+
N,
|
|
35
36
|
{
|
|
36
|
-
src: e != null && e.chainIconUrl ? e == null ? void 0 : e.chainIconUrl : `//cdn.ichaingo.com/module/cryptos/${(
|
|
37
|
+
src: e != null && e.chainIconUrl ? e == null ? void 0 : e.chainIconUrl : `//cdn.ichaingo.com/module/cryptos/${(s = (t = e == null ? void 0 : e.chain) == null ? void 0 : t.toLowerCase()) == null ? void 0 : s.replace(" ", "-")}.png?format=auto&width=20&height=20`,
|
|
37
38
|
className: "w-5 h-5",
|
|
38
39
|
objectFit: "contain"
|
|
39
40
|
}
|
|
@@ -43,9 +44,9 @@ function q({ onClick: o = () => {
|
|
|
43
44
|
}
|
|
44
45
|
);
|
|
45
46
|
};
|
|
46
|
-
return /* @__PURE__ */ a(
|
|
47
|
+
return /* @__PURE__ */ a(g, { children: [
|
|
47
48
|
/* @__PURE__ */ r("div", { className: "hidden md:block", children: /* @__PURE__ */ r(
|
|
48
|
-
|
|
49
|
+
v,
|
|
49
50
|
{
|
|
50
51
|
getPopupContainer: () => document.body,
|
|
51
52
|
classNames: {
|
|
@@ -54,38 +55,32 @@ function q({ onClick: o = () => {
|
|
|
54
55
|
arrow: { pointAtCenter: !0 },
|
|
55
56
|
placement: "bottom",
|
|
56
57
|
menu: {
|
|
57
|
-
items:
|
|
58
|
-
label:
|
|
58
|
+
items: n.map((e) => ({
|
|
59
|
+
label: c(e),
|
|
59
60
|
key: e.chainSymbol
|
|
60
61
|
}))
|
|
61
62
|
},
|
|
62
|
-
children: /* @__PURE__ */ r("div", { className: "whitespace-nowrap flex items-center gap-1 rounded-lg", children: /* @__PURE__ */ r(
|
|
63
|
+
children: /* @__PURE__ */ r("div", { className: "whitespace-nowrap flex items-center gap-1 rounded-lg", children: /* @__PURE__ */ r(d, { value: "title", parentKey: "browser" }) })
|
|
63
64
|
}
|
|
64
65
|
) }),
|
|
65
|
-
/* @__PURE__ */ r("div", { className: "md:hidden w-full", children:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
) })
|
|
83
|
-
) : (
|
|
84
|
-
// 非 explorer 页面:让外层 Link 正常跳转
|
|
85
|
-
/* @__PURE__ */ r("div", { className: "whitespace-nowrap flex items-center gap-1 rounded-lg", children: /* @__PURE__ */ r(n, { value: "title", parentKey: "browser" }) })
|
|
86
|
-
) })
|
|
66
|
+
/* @__PURE__ */ r("div", { className: "md:hidden w-full", children: /* @__PURE__ */ r("div", { onClick: (e) => {
|
|
67
|
+
e.preventDefault(), e.stopPropagation();
|
|
68
|
+
}, children: /* @__PURE__ */ r(
|
|
69
|
+
L,
|
|
70
|
+
{
|
|
71
|
+
type: "single",
|
|
72
|
+
collapsible: !0,
|
|
73
|
+
className: "w-full",
|
|
74
|
+
value: f,
|
|
75
|
+
onValueChange: l,
|
|
76
|
+
children: /* @__PURE__ */ a(I, { value: "explorer", className: "border-0", children: [
|
|
77
|
+
/* @__PURE__ */ r(S, { className: "rounded-lg font-medium h-11 w-full flex py-2 justify-between items-center hover:no-underline focus-visible:ring-0 focus-visible:ring-offset-0", children: /* @__PURE__ */ r("div", { className: "flex w-full justify-between items-center", children: /* @__PURE__ */ r("span", { className: "text-title", children: /* @__PURE__ */ r(d, { value: "title", parentKey: "browser" }) }) }) }),
|
|
78
|
+
/* @__PURE__ */ r(j, { className: "mt-3 rounded-lg flex flex-col gap-2 max-h-[60vh] overflow-auto", children: n.map((e) => /* @__PURE__ */ r("div", { className: "w-full", children: c(e) }, e.chainSymbol)) })
|
|
79
|
+
] })
|
|
80
|
+
}
|
|
81
|
+
) }) })
|
|
87
82
|
] });
|
|
88
83
|
}
|
|
89
84
|
export {
|
|
90
|
-
|
|
85
|
+
F as default
|
|
91
86
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ichaingo/header",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.34",
|
|
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/image": "1.5.
|
|
36
|
-
"@ichaingo/auth": "1.5.
|
|
37
|
-
"@ichaingo/
|
|
38
|
-
"@ichaingo/
|
|
39
|
-
"@ichaingo/better-link": "1.5.
|
|
40
|
-
"@ichaingo/
|
|
41
|
-
"@ichaingo/
|
|
42
|
-
"@ichaingo/
|
|
43
|
-
"@ichaingo/
|
|
44
|
-
"@ichaingo/
|
|
45
|
-
"@ichaingo/
|
|
46
|
-
"@ichaingo/
|
|
47
|
-
"@ichaingo/
|
|
35
|
+
"@ichaingo/image": "1.5.34",
|
|
36
|
+
"@ichaingo/auth": "1.5.34",
|
|
37
|
+
"@ichaingo/avatar": "1.5.34",
|
|
38
|
+
"@ichaingo/ui": "1.5.34",
|
|
39
|
+
"@ichaingo/better-link": "1.5.34",
|
|
40
|
+
"@ichaingo/link": "1.5.34",
|
|
41
|
+
"@ichaingo/translation": "1.5.34",
|
|
42
|
+
"@ichaingo/iconfont": "1.5.34",
|
|
43
|
+
"@ichaingo/request": "1.5.34",
|
|
44
|
+
"@ichaingo/with-login": "1.5.34",
|
|
45
|
+
"@ichaingo/tooltip": "1.5.34",
|
|
46
|
+
"@ichaingo/token": "1.5.34",
|
|
47
|
+
"@ichaingo/theme-toggle": "1.5.34"
|
|
48
48
|
}
|
|
49
49
|
}
|