@ichaingo/header 1.4.13 → 1.4.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.
package/dist/index.js CHANGED
@@ -4,8 +4,8 @@ import d from "@ichaingo/request";
4
4
  import { cookies as l } from "next/headers";
5
5
  import x from "./lib/Right.js";
6
6
  import h from "./lib/Logo.js";
7
- import { USER_EVENTS as R, emitUserEvent as S, onUserEvent as T } from "./lib/events.js";
8
- async function _({ extra: i, children: s, className: c, hideNews: n, hideLogin: m }) {
7
+ import { USER_EVENTS as _, emitUserEvent as S, onUserEvent as T } from "./lib/events.js";
8
+ async function b({ extra: i, children: s, className: c, hideNews: n, hideLogin: m }) {
9
9
  var r;
10
10
  let e = {
11
11
  data: {}
@@ -15,7 +15,7 @@ async function _({ extra: i, children: s, className: c, hideNews: n, hideLogin:
15
15
  if (typeof o < "u" && o !== "")
16
16
  try {
17
17
  e = await d.get("/v2/users/profile", {
18
- baseURL: process.env.ICHAINGO_AUTH_INNER_API_URL
18
+ baseURL: process.env.AUTH_INNER_API_URL
19
19
  });
20
20
  } catch (f) {
21
21
  console.error(f), e = { data: {} };
@@ -35,8 +35,8 @@ async function _({ extra: i, children: s, className: c, hideNews: n, hideLogin:
35
35
  ] });
36
36
  }
37
37
  export {
38
- R as USER_EVENTS,
39
- _ as default,
38
+ _ as USER_EVENTS,
39
+ b as default,
40
40
  S as emitUserEvent,
41
41
  T as onUserEvent
42
42
  };
package/dist/lib/Logo.js CHANGED
@@ -4,7 +4,7 @@ import o from "@ichaingo/image";
4
4
  import t from "@ichaingo/link";
5
5
  import { twMerge as e } from "tailwind-merge";
6
6
  function p() {
7
- return /* @__PURE__ */ r(t, { suppressHydrationWarning: !0, href: "/", baseUrl: process.env.NEXT_PUBLIC_ICHAINGO_SEARCH_BASEURL, className: e(
7
+ return /* @__PURE__ */ r(t, { suppressHydrationWarning: !0, href: "/", baseUrl: process.env.NEXT_PUBLIC_APP_URL, className: e(
8
8
  "w-auto shrink-0 block cursor-pointer"
9
9
  ), children: /* @__PURE__ */ r(
10
10
  o,
package/dist/lib/Nav.js CHANGED
@@ -1,71 +1,71 @@
1
1
  'use client';
2
- import { jsx as e, jsxs as n, Fragment as y } from "react/jsx-runtime";
3
- import E from "@ichaingo/link";
2
+ import { jsx as e, jsxs as m, Fragment as w } from "react/jsx-runtime";
3
+ import P from "@ichaingo/link";
4
4
  import L from "./User/index.js";
5
- import N from "./Setting/index.js";
5
+ import _ from "./Setting/index.js";
6
6
  import l from "@ichaingo/translation";
7
- import { twMerge as o } from "tailwind-merge";
8
- import I from "@ichaingo/better-link";
9
- import { useLocale as A } from "next-intl";
10
- import v from "./User/Logout.js";
11
- import { useState as d, useCallback as C, useEffect as S } from "react";
12
- import k from "./User/SignIn.js";
13
- import { fetchUserProfile as P } from "@ichaingo/auth";
14
- import { onUserEvent as R, cleanUserEvent as T, USER_EVENTS as c } from "./events.js";
15
- import { usePathname as B } from "next/navigation";
16
- function J({ onClick: t = () => {
17
- }, hideNews: f = !1, hideLogin: u = !1, user: h }) {
18
- const { gotoAISQL: U, gotoChat: g } = I(), i = A(), m = B(), [x, b] = d(""), [s, _] = d(h), w = [
7
+ import { twMerge as n } from "tailwind-merge";
8
+ import v from "@ichaingo/better-link";
9
+ import { useLocale as E } from "next-intl";
10
+ import N from "./User/Logout.js";
11
+ import { useState as f, useCallback as k, useEffect as I } from "react";
12
+ import T from "./User/SignIn.js";
13
+ import { fetchUserProfile as A } from "@ichaingo/auth";
14
+ import { onUserEvent as j, cleanUserEvent as R, USER_EVENTS as d } from "./events.js";
15
+ import { usePathname as S } from "next/navigation";
16
+ function G({ onClick: t = () => {
17
+ }, hideNews: p = !1, hideLogin: u = !1, user: c }) {
18
+ const { gotoAISQL: h } = v(), U = E(), o = S(), [x, g] = f(""), [s, b] = f(c), y = [
19
19
  {
20
- baseUrl: process.env.NEXT_PUBLIC_ICHAINGO_SEARCH_BASEURL,
20
+ baseUrl: process.env.NEXT_PUBLIC_APP_URL,
21
21
  href: "/explorer",
22
22
  key: "/explorer",
23
23
  label: /* @__PURE__ */ e("span", { className: "whitespace-nowrap leading-11 md:leading-[34px]", children: /* @__PURE__ */ e(l, { value: "title", parentKey: "browser" }) })
24
24
  },
25
+ // {
26
+ // baseUrl: process.env.NEXT_PUBLIC_CHAT_URL,
27
+ // href: gotoChat({ locale: locale }),
28
+ // key: '/chat',
29
+ // label: <span className="whitespace-nowrap leading-11 md:leading-[34px]">
30
+ // <span role="img" aria-label="hot">🔥</span>
31
+ // <span>iGoChat</span>
32
+ // </span>,
33
+ // },
25
34
  {
26
- baseUrl: process.env.NEXT_PUBLIC_CHAT_URL,
27
- href: g({ locale: i }),
28
- key: "/chat",
29
- label: /* @__PURE__ */ n("span", { className: "whitespace-nowrap leading-11 md:leading-[34px]", children: [
30
- /* @__PURE__ */ e("span", { role: "img", "aria-label": "hot", children: "🔥" }),
31
- /* @__PURE__ */ e("span", { children: "iGoChat" })
32
- ] })
33
- },
34
- {
35
- baseUrl: process.env.NEXT_PUBLIC_CHAT_URL,
36
- href: U({ locale: i }),
35
+ baseUrl: process.env.NEXT_PUBLIC_APP_URL,
36
+ href: h({ locale: U }),
37
37
  key: "/sql",
38
38
  label: "AISQL"
39
39
  },
40
40
  {
41
- baseUrl: process.env.NEXT_PUBLIC_ICHAINGO_SEARCH_BASEURL,
41
+ baseUrl: process.env.NEXT_PUBLIC_APP_URL,
42
42
  href: "/etf/btc-us",
43
43
  key: "/etf",
44
44
  label: /* @__PURE__ */ e(l, { value: "etf", parentKey: "menu" })
45
45
  },
46
46
  {
47
- baseUrl: process.env.NEXT_PUBLIC_ICHAINGO_SEARCH_BASEURL,
47
+ baseUrl: process.env.NEXT_PUBLIC_APP_URL,
48
48
  href: "/news",
49
49
  key: "/news",
50
50
  label: /* @__PURE__ */ e(l, { value: "news", parentKey: "menu" })
51
51
  },
52
52
  {
53
- baseUrl: process.env.NEXT_PUBLIC_ICHAINGO_SEARCH_BASEURL,
53
+ baseUrl: process.env.NEXT_PUBLIC_APP_URL,
54
54
  href: "/ranking/token",
55
55
  key: "/ranking",
56
56
  label: /* @__PURE__ */ e(l, { value: "ranking", parentKey: "menu" })
57
57
  }
58
- ].filter((r) => f ? !["/explorer", "/chat", "/sql"].includes(r.key) : !0), p = C(() => new Promise((r) => {
59
- P().then((a) => {
60
- _(a), b((/* @__PURE__ */ new Date()).getTime().toString()), r(a);
58
+ ].filter((r) => p ? !["/explorer", "/chat", "/sql"].includes(r.key) : !0), i = k(() => new Promise((r) => {
59
+ A().then((a) => {
60
+ b(a), g((/* @__PURE__ */ new Date()).getTime().toString()), r(a);
61
61
  });
62
62
  }), []);
63
- return S(() => (R(c.PROFILE_UPDATED, p), () => {
64
- T(c.PROFILE_UPDATED, p);
65
- }), []), /* @__PURE__ */ n(
63
+ return I(() => (j(d.PROFILE_UPDATED, i), () => {
64
+ R(d.PROFILE_UPDATED, i);
65
+ }), []), /* @__PURE__ */ m(
66
66
  "nav",
67
67
  {
68
- className: o(
68
+ className: n(
69
69
  "flex flex-col justify-start items-start md:px-3",
70
70
  "md:flex-row md:justify-end md:items-start md:px-0",
71
71
  "md:gap-6"
@@ -74,23 +74,23 @@ function J({ onClick: t = () => {
74
74
  /* @__PURE__ */ e(
75
75
  "ul",
76
76
  {
77
- className: o(
77
+ className: n(
78
78
  "flex flex-col justify-start items-start w-full h-full text-sm leading-[44px] z-1001 text-title",
79
79
  "md:flex-row md:items-center md:w-auto md:h-[34px] md:leading-[34px] md:gap-6",
80
80
  "order-2 md:order-0"
81
81
  ),
82
- children: w.map((r, a) => /* @__PURE__ */ e("li", { className: o("w-full md:w-auto h-11 md:h-auto cursor-pointer", m.includes(r.key) && "border-b-2 border-primary text-primary "), children: /* @__PURE__ */ e(E, { href: r.href, onClick: t, className: "h-full flex items-center justify-start", baseUrl: r.baseUrl, suppressHydrationWarning: !0, children: r.label }) }, a))
82
+ children: y.map((r, a) => /* @__PURE__ */ e("li", { className: n("w-full md:w-auto h-11 md:h-auto cursor-pointer", o.includes(r.key) && "border-b-2 border-primary text-primary "), children: /* @__PURE__ */ e(P, { href: r.href, onClick: t, className: "h-full flex items-center justify-start", baseUrl: r.baseUrl, suppressHydrationWarning: !0, children: r.label }) }, a))
83
83
  }
84
84
  ),
85
- /* @__PURE__ */ e(N, { onClick: t }),
86
- !m.includes("/login") && !u ? /* @__PURE__ */ n(y, { children: [
85
+ /* @__PURE__ */ e(_, { onClick: t }),
86
+ !o.includes("/login") && !u ? /* @__PURE__ */ m(w, { children: [
87
87
  /* @__PURE__ */ e(L, { onClick: t, userInfo: s }, x),
88
- s != null && s.id ? /* @__PURE__ */ e("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__ */ e(v, {}) }) : /* @__PURE__ */ e(k, { onClick: t, 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" })
88
+ s != null && s.id ? /* @__PURE__ */ e("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__ */ e(N, {}) }) : /* @__PURE__ */ e(T, { onClick: t, 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" })
89
89
  ] }) : null
90
90
  ]
91
91
  }
92
92
  );
93
93
  }
94
94
  export {
95
- J as default
95
+ G as default
96
96
  };
@@ -28,7 +28,7 @@ function b({
28
28
  "dd",
29
29
  {
30
30
  className: "flex justify-start items-center gap-2 py-2",
31
- children: /* @__PURE__ */ e(i, { href: `/${a.href}`, className: "flex-1 py-2", onClick: t, suppressHydrationWarning: !0, baseUrl: process.env.NEXT_PUBLIC_AUTH_URL, children: /* @__PURE__ */ e(o, { value: a.name, parentKey: "account" }) })
31
+ children: /* @__PURE__ */ e(i, { href: `/${a.href}`, className: "flex-1 py-2", onClick: t, suppressHydrationWarning: !0, baseUrl: process.env.NEXT_PUBLIC_APP_URL, children: /* @__PURE__ */ e(o, { value: a.name, parentKey: "account" }) })
32
32
  },
33
33
  a.name
34
34
  )) }) })
@@ -21,7 +21,7 @@ function M({
21
21
  /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground w-full truncate", children: (l == null ? void 0 : l.email) || (l == null ? void 0 : l.walletAddress) })
22
22
  ] })
23
23
  ] }) }),
24
- o.map((r) => /* @__PURE__ */ e(m, { className: "px-0 py-0 focus-visible:border-none focus-visible:outline-none", children: /* @__PURE__ */ e("div", { className: "flex items-center gap-2 w-full", children: r.name === "logout" ? /* @__PURE__ */ e(g, { className: "flex-1 flex py-3 border-t border-stroke w-full px-2 hover:bg-background" }) : /* @__PURE__ */ e(s, { href: `/${r.href}`, baseUrl: process.env.NEXT_PUBLIC_AUTH_URL, className: "flex-1 flex py-3 h-full w-full px-2 hover:bg-background rounded-lg ", onClick: n, children: /* @__PURE__ */ e(p, { value: r.name, parentKey: "account" }) }) }) }, r.name))
24
+ o.map((r) => /* @__PURE__ */ e(m, { className: "px-0 py-0 focus-visible:border-none focus-visible:outline-none", children: /* @__PURE__ */ e("div", { className: "flex items-center gap-2 w-full", children: r.name === "logout" ? /* @__PURE__ */ e(g, { className: "flex-1 flex py-3 border-t border-stroke w-full px-2 hover:bg-background" }) : /* @__PURE__ */ e(s, { href: `/${r.href}`, baseUrl: process.env.NEXT_PUBLIC_APP_URL, className: "flex-1 flex py-3 h-full w-full px-2 hover:bg-background rounded-lg ", onClick: n, children: /* @__PURE__ */ e(p, { value: r.name, parentKey: "account" }) }) }) }, r.name))
25
25
  ] }) })
26
26
  ] });
27
27
  }
@@ -5,7 +5,7 @@ import c from "@ichaingo/better-link";
5
5
  import p from "@ichaingo/translation";
6
6
  import { twMerge as f } from "tailwind-merge";
7
7
  import { useState as l, useEffect as u } from "react";
8
- function U({ onClick: t = () => {
8
+ function v({ onClick: t = () => {
9
9
  }, className: n }) {
10
10
  const r = m(), { gotoLogin: e } = c(), [i, s] = l("");
11
11
  return u(() => {
@@ -18,7 +18,7 @@ function U({ onClick: t = () => {
18
18
  {
19
19
  href: i,
20
20
  onClick: t,
21
- baseUrl: process.env.NEXT_PUBLIC_AUTH_URL,
21
+ baseUrl: process.env.NEXT_PUBLIC_APP_URL,
22
22
  replace: !0,
23
23
  className: f(
24
24
  "cursor-pointer text-sm text-white bg-primary py-2 px-3 rounded-lg",
@@ -29,5 +29,5 @@ function U({ onClick: t = () => {
29
29
  );
30
30
  }
31
31
  export {
32
- U as default
32
+ v as default
33
33
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ichaingo/header",
3
- "version": "1.4.13",
3
+ "version": "1.4.15",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -29,18 +29,18 @@
29
29
  "rollup-plugin-preserve-use-client": "^1.0.0",
30
30
  "tailwind-merge": "^2.5.5",
31
31
  "next": "15.1.6",
32
- "@ichaingo/auth": "1.4.13",
33
- "@ichaingo/link": "1.4.13",
34
- "@ichaingo/image": "1.4.13",
35
- "@ichaingo/translation": "1.4.13",
36
- "@ichaingo/i18n": "1.4.13",
37
- "@ichaingo/ui": "1.4.13",
38
- "@ichaingo/theme-toggle": "1.4.13",
39
- "@ichaingo/avatar": "1.4.13",
40
- "@ichaingo/iconfont": "1.4.13",
41
- "@ichaingo/request": "1.4.13",
42
- "@ichaingo/providers": "1.4.13",
43
- "@ichaingo/better-link": "1.4.13"
32
+ "@ichaingo/image": "1.4.15",
33
+ "@ichaingo/translation": "1.4.15",
34
+ "@ichaingo/ui": "1.4.15",
35
+ "@ichaingo/theme-toggle": "1.4.15",
36
+ "@ichaingo/auth": "1.4.15",
37
+ "@ichaingo/link": "1.4.15",
38
+ "@ichaingo/iconfont": "1.4.15",
39
+ "@ichaingo/request": "1.4.15",
40
+ "@ichaingo/i18n": "1.4.15",
41
+ "@ichaingo/avatar": "1.4.15",
42
+ "@ichaingo/better-link": "1.4.15",
43
+ "@ichaingo/providers": "1.4.15"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/js-cookie": "^3.0.6"