@0xchain/header 1.1.0-beta.5 → 1.1.0-beta.6
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 +34 -34
- package/package.json +14 -14
package/dist/lib/Explorer.js
CHANGED
|
@@ -1,37 +1,36 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import
|
|
2
|
+
import { jsxs as t, Fragment as w, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import m from "@0xchain/translation";
|
|
4
4
|
import { Dropdown as b } from "antd";
|
|
5
|
-
import { useState as
|
|
6
|
-
import
|
|
5
|
+
import { useState as f, useEffect as y } from "react";
|
|
6
|
+
import N from "@0xchain/request";
|
|
7
7
|
import x from "@0xchain/better-link";
|
|
8
|
-
import
|
|
9
|
-
import { usePathname as I } from "next/navigation";
|
|
10
|
-
import { Accordion as
|
|
11
|
-
function
|
|
8
|
+
import j from "@0xchain/image";
|
|
9
|
+
import { usePathname as A, useRouter as I } from "next/navigation";
|
|
10
|
+
import { Accordion as S, AccordionItem as L, AccordionTrigger as P } from "@0xchain/ui/accordion";
|
|
11
|
+
function q({ onClick: a = () => {
|
|
12
12
|
}, onExpandChange: n }) {
|
|
13
|
-
|
|
14
|
-
const { gotoExplorer:
|
|
15
|
-
const e = await
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
e.preventDefault(), e.stopPropagation(), a == null || a(), i("");
|
|
19
|
-
const l =
|
|
20
|
-
|
|
13
|
+
A();
|
|
14
|
+
const p = I(), { gotoExplorer: h } = x(), [s, v] = f([]), [c, i] = f(""), g = async () => {
|
|
15
|
+
const e = await N.get("/api/v2/chains/all-chain-list/basic");
|
|
16
|
+
v(e.data);
|
|
17
|
+
}, d = (e, o) => {
|
|
18
|
+
e == null || e.preventDefault(), e == null || e.stopPropagation(), a == null || a(), i("");
|
|
19
|
+
const l = h({ chain: o.chainSymbol });
|
|
20
|
+
p.push(l);
|
|
21
21
|
};
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
y(() => {
|
|
23
|
+
g();
|
|
24
24
|
}, []);
|
|
25
|
-
const
|
|
25
|
+
const u = (e) => {
|
|
26
26
|
var o, l;
|
|
27
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ t(
|
|
28
28
|
"div",
|
|
29
29
|
{
|
|
30
|
-
onClick: (w) => v(w, e),
|
|
31
30
|
className: "w-full h-full flex items-center gap-2 py-2 cursor-pointer font-medium",
|
|
32
31
|
children: [
|
|
33
32
|
/* @__PURE__ */ r(
|
|
34
|
-
|
|
33
|
+
j,
|
|
35
34
|
{
|
|
36
35
|
src: e != null && e.chainIconUrl ? e == null ? void 0 : e.chainIconUrl : `//cdn.ichaingo.com/module/cryptos/${(l = (o = e == null ? void 0 : e.chain) == null ? void 0 : o.toLowerCase()) == null ? void 0 : l.replace(" ", "-")}.png?format=auto&width=20&height=20`,
|
|
37
36
|
className: "w-5 h-5",
|
|
@@ -43,7 +42,7 @@ function K({ onClick: a = () => {
|
|
|
43
42
|
}
|
|
44
43
|
);
|
|
45
44
|
};
|
|
46
|
-
return /* @__PURE__ */
|
|
45
|
+
return /* @__PURE__ */ t(w, { children: [
|
|
47
46
|
/* @__PURE__ */ r("div", { className: "hidden md:block", children: /* @__PURE__ */ r(
|
|
48
47
|
b,
|
|
49
48
|
{
|
|
@@ -54,41 +53,42 @@ function K({ onClick: a = () => {
|
|
|
54
53
|
arrow: { pointAtCenter: !0 },
|
|
55
54
|
placement: "bottom",
|
|
56
55
|
menu: {
|
|
57
|
-
items:
|
|
58
|
-
label:
|
|
59
|
-
key: e.chainSymbol
|
|
56
|
+
items: s.map((e) => ({
|
|
57
|
+
label: u(e),
|
|
58
|
+
key: e.chainSymbol,
|
|
59
|
+
onClick: (o) => d(o.domEvent, e)
|
|
60
60
|
}))
|
|
61
61
|
},
|
|
62
|
-
children: /* @__PURE__ */ r("div", { className: "whitespace-nowrap flex items-center gap-1 rounded-lg", children: /* @__PURE__ */ r(
|
|
62
|
+
children: /* @__PURE__ */ r("div", { className: "whitespace-nowrap flex items-center gap-1 rounded-lg", children: /* @__PURE__ */ r(m, { value: "title", parentKey: "browser" }) })
|
|
63
63
|
}
|
|
64
64
|
) }),
|
|
65
|
-
/* @__PURE__ */ r("div", { className: "md:hidden w-full", children: /* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ r("div", { className: "md:hidden w-full", children: /* @__PURE__ */ t("div", { onClick: (e) => {
|
|
66
66
|
e.preventDefault(), e.stopPropagation();
|
|
67
67
|
}, children: [
|
|
68
68
|
/* @__PURE__ */ r(
|
|
69
|
-
|
|
69
|
+
S,
|
|
70
70
|
{
|
|
71
71
|
type: "single",
|
|
72
72
|
collapsible: !0,
|
|
73
73
|
className: "w-full",
|
|
74
|
-
value:
|
|
74
|
+
value: c,
|
|
75
75
|
onValueChange: (e) => {
|
|
76
76
|
i(e), n == null || n(!!e);
|
|
77
77
|
},
|
|
78
|
-
children: /* @__PURE__ */ r(
|
|
78
|
+
children: /* @__PURE__ */ r(L, { value: "explorer", className: "border-0", children: /* @__PURE__ */ r(P, { 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-foreground", children: /* @__PURE__ */ r(m, { value: "title", parentKey: "browser" }) }) }) }) })
|
|
79
79
|
}
|
|
80
80
|
),
|
|
81
81
|
/* @__PURE__ */ r(
|
|
82
82
|
"div",
|
|
83
83
|
{
|
|
84
84
|
className: "grid transition-[grid-template-rows] duration-300 ease-in-out",
|
|
85
|
-
style: { gridTemplateRows:
|
|
86
|
-
children: /* @__PURE__ */ r("div", { className: "overflow-hidden", children: /* @__PURE__ */ r("div", { className: "mt-3 rounded-lg flex flex-col gap-2 max-h-[60vh] overflow-auto", children:
|
|
85
|
+
style: { gridTemplateRows: c ? "1fr" : "0fr" },
|
|
86
|
+
children: /* @__PURE__ */ r("div", { className: "overflow-hidden", children: /* @__PURE__ */ r("div", { className: "mt-3 rounded-lg flex flex-col gap-2 max-h-[60vh] overflow-auto", children: s.map((e) => /* @__PURE__ */ r("div", { className: "w-full", onClick: (o) => d(o, e), children: u(e) }, e.chainSymbol)) }) })
|
|
87
87
|
}
|
|
88
88
|
)
|
|
89
89
|
] }) })
|
|
90
90
|
] });
|
|
91
91
|
}
|
|
92
92
|
export {
|
|
93
|
-
|
|
93
|
+
q as default
|
|
94
94
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xchain/header",
|
|
3
|
-
"version": "1.1.0-beta.
|
|
3
|
+
"version": "1.1.0-beta.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -32,19 +32,19 @@
|
|
|
32
32
|
"tailwind-merge": "3.3.1",
|
|
33
33
|
"next": "15.5.6",
|
|
34
34
|
"antd": "6.1.1",
|
|
35
|
-
"@0xchain/
|
|
36
|
-
"@0xchain/
|
|
37
|
-
"@0xchain/image": "1.1.0-beta.
|
|
38
|
-
"@0xchain/auth": "1.1.0-beta.
|
|
39
|
-
"@0xchain/
|
|
40
|
-
"@0xchain/
|
|
41
|
-
"@0xchain/
|
|
42
|
-
"@0xchain/
|
|
43
|
-
"@0xchain/
|
|
44
|
-
"@0xchain/
|
|
45
|
-
"@0xchain/
|
|
46
|
-
"@0xchain/
|
|
47
|
-
"@0xchain/
|
|
35
|
+
"@0xchain/better-link": "1.1.0-beta.6",
|
|
36
|
+
"@0xchain/link": "1.1.0-beta.6",
|
|
37
|
+
"@0xchain/image": "1.1.0-beta.6",
|
|
38
|
+
"@0xchain/auth": "1.1.0-beta.6",
|
|
39
|
+
"@0xchain/avatar": "1.1.0-beta.6",
|
|
40
|
+
"@0xchain/theme-toggle": "1.1.0-beta.6",
|
|
41
|
+
"@0xchain/iconfont": "1.1.0-beta.6",
|
|
42
|
+
"@0xchain/with-login": "1.1.0-beta.6",
|
|
43
|
+
"@0xchain/tooltip": "1.1.0-beta.6",
|
|
44
|
+
"@0xchain/token": "1.1.0-beta.6",
|
|
45
|
+
"@0xchain/request": "1.1.0-beta.6",
|
|
46
|
+
"@0xchain/translation": "1.1.0-beta.6",
|
|
47
|
+
"@0xchain/ui": "1.1.0-beta.6"
|
|
48
48
|
},
|
|
49
49
|
"publishConfig": {
|
|
50
50
|
"access": "public"
|