@0xchain/header 1.1.0-beta.14 → 1.1.0-beta.15

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 +24 -24
  2. package/package.json +14 -14
@@ -1,36 +1,36 @@
1
1
  'use client';
2
- import { jsxs as t, Fragment as w, jsx as r } from "react/jsx-runtime";
2
+ import { jsxs as s, Fragment as g, jsx as r } from "react/jsx-runtime";
3
3
  import m from "@0xchain/translation";
4
4
  import { Dropdown as b } from "antd";
5
- import { useState as f, useEffect as y } from "react";
6
- import N from "@0xchain/request";
5
+ import { useState as f, useEffect as N } from "react";
6
+ import y from "@0xchain/request";
7
7
  import x from "@0xchain/better-link";
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 = () => {
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 C({ onClick: a = () => {
12
12
  }, onExpandChange: n }) {
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);
13
+ I();
14
+ const { gotoExplorer: p } = x(), [t, h] = f([]), [c, i] = f(""), v = async () => {
15
+ const e = await y.get("/api/v2/chains/all-chain-list/basic");
16
+ h(e.data);
17
17
  }, d = (e, o) => {
18
18
  e == null || e.preventDefault(), e == null || e.stopPropagation(), a == null || a(), i("");
19
- const l = h({ chain: o.chainSymbol });
20
- p.push(l);
19
+ const l = p({ chain: o.chainSymbol }), w = process.env.NEXT_PUBLIC_BASE_URL || "";
20
+ window.location.href = `${w}${l}`;
21
21
  };
22
- y(() => {
23
- g();
22
+ N(() => {
23
+ v();
24
24
  }, []);
25
25
  const u = (e) => {
26
26
  var o, l;
27
- return /* @__PURE__ */ t(
27
+ return /* @__PURE__ */ s(
28
28
  "div",
29
29
  {
30
30
  className: "w-full h-full flex items-center gap-2 py-2 cursor-pointer font-medium",
31
31
  children: [
32
32
  /* @__PURE__ */ r(
33
- j,
33
+ A,
34
34
  {
35
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`,
36
36
  className: "w-5 h-5",
@@ -42,7 +42,7 @@ function q({ onClick: a = () => {
42
42
  }
43
43
  );
44
44
  };
45
- return /* @__PURE__ */ t(w, { children: [
45
+ return /* @__PURE__ */ s(g, { children: [
46
46
  /* @__PURE__ */ r("div", { className: "hidden md:block", children: /* @__PURE__ */ r(
47
47
  b,
48
48
  {
@@ -53,7 +53,7 @@ function q({ onClick: a = () => {
53
53
  arrow: { pointAtCenter: !0 },
54
54
  placement: "bottom",
55
55
  menu: {
56
- items: s.map((e) => ({
56
+ items: t.map((e) => ({
57
57
  label: u(e),
58
58
  key: e.chainSymbol,
59
59
  onClick: (o) => d(o.domEvent, e)
@@ -62,11 +62,11 @@ function q({ onClick: a = () => {
62
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__ */ t("div", { onClick: (e) => {
65
+ /* @__PURE__ */ r("div", { className: "md:hidden w-full", children: /* @__PURE__ */ s("div", { onClick: (e) => {
66
66
  e.preventDefault(), e.stopPropagation();
67
67
  }, children: [
68
68
  /* @__PURE__ */ r(
69
- S,
69
+ L,
70
70
  {
71
71
  type: "single",
72
72
  collapsible: !0,
@@ -75,7 +75,7 @@ function q({ onClick: a = () => {
75
75
  onValueChange: (e) => {
76
76
  i(e), n == null || n(!!e);
77
77
  },
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" }) }) }) }) })
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(m, { value: "title", parentKey: "browser" }) }) }) }) })
79
79
  }
80
80
  ),
81
81
  /* @__PURE__ */ r(
@@ -83,12 +83,12 @@ function q({ onClick: a = () => {
83
83
  {
84
84
  className: "grid transition-[grid-template-rows] duration-300 ease-in-out",
85
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)) }) })
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: t.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
- q as default
93
+ C 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.14",
3
+ "version": "1.1.0-beta.15",
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": "16.1.6",
34
34
  "antd": "6.1.1",
35
- "@0xchain/auth": "1.1.0-beta.14",
36
- "@0xchain/better-link": "1.1.0-beta.14",
37
- "@0xchain/image": "1.1.0-beta.14",
38
- "@0xchain/avatar": "1.1.0-beta.14",
39
- "@0xchain/translation": "1.1.0-beta.14",
40
- "@0xchain/link": "1.1.0-beta.14",
41
- "@0xchain/request": "1.1.0-beta.14",
42
- "@0xchain/tooltip": "1.1.0-beta.14",
43
- "@0xchain/token": "1.1.0-beta.14",
44
- "@0xchain/with-login": "1.1.0-beta.14",
45
- "@0xchain/theme-toggle": "1.1.0-beta.14",
46
- "@0xchain/iconfont": "1.1.0-beta.14",
47
- "@0xchain/ui": "1.1.0-beta.14"
35
+ "@0xchain/better-link": "1.1.0-beta.15",
36
+ "@0xchain/auth": "1.1.0-beta.15",
37
+ "@0xchain/avatar": "1.1.0-beta.15",
38
+ "@0xchain/link": "1.1.0-beta.15",
39
+ "@0xchain/ui": "1.1.0-beta.15",
40
+ "@0xchain/image": "1.1.0-beta.15",
41
+ "@0xchain/iconfont": "1.1.0-beta.15",
42
+ "@0xchain/translation": "1.1.0-beta.15",
43
+ "@0xchain/theme-toggle": "1.1.0-beta.15",
44
+ "@0xchain/with-login": "1.1.0-beta.15",
45
+ "@0xchain/request": "1.1.0-beta.15",
46
+ "@0xchain/tooltip": "1.1.0-beta.15",
47
+ "@0xchain/token": "1.1.0-beta.15"
48
48
  },
49
49
  "publishConfig": {
50
50
  "access": "public"