@0xchain/header 1.1.0-beta.4 → 1.1.0-beta.5

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