@ichaingo/header 1.5.17 → 1.5.19

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