@0xchain/header 1.1.0-beta.50 → 1.1.0-beta.51

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/Nav.js +8 -10
  2. package/package.json +14 -14
package/dist/lib/Nav.js CHANGED
@@ -16,9 +16,10 @@ import { usePathname } from "next/navigation";
16
16
  import Explorer from "./Explorer.js";
17
17
  import Products from "./Products.js";
18
18
  import { useIsChaindigg } from "./context.js";
19
+ import request from "@0xchain/request";
19
20
  function Nav({ onClick = () => void 0, hideNews = false, hideLogin = false, user }) {
20
21
  const isChaindigg = useIsChaindigg();
21
- const { gotoAISQL, gotoChat, gotoExplorer } = BetterLink();
22
+ const { gotoAISQL, gotoChat } = BetterLink();
22
23
  const locale = useLocale();
23
24
  const pathname = usePathname();
24
25
  const [userKey, setUserKey] = useState("");
@@ -44,6 +45,7 @@ function Nav({ onClick = () => void 0, hideNews = false, hideLogin = false, user
44
45
  }
45
46
  },
46
47
  {
48
+ baseUrl: process.env.NEXT_PUBLIC_BASE_URL,
47
49
  key: "/explorer",
48
50
  href: "/explorer",
49
51
  label: /* @__PURE__ */ jsx(Explorer, { onClick, onExpandChange: setExplorerExpanded }),
@@ -52,6 +54,7 @@ function Nav({ onClick = () => void 0, hideNews = false, hideLogin = false, user
52
54
  }
53
55
  },
54
56
  {
57
+ baseUrl: process.env.NEXT_PUBLIC_BASE_URL,
55
58
  key: "/products",
56
59
  label: /* @__PURE__ */ jsx(Products, { onClick }),
57
60
  show: (pathname2) => {
@@ -103,17 +106,12 @@ function Nav({ onClick = () => void 0, hideNews = false, hideLogin = false, user
103
106
  const NavList = isChaindigg ? chaindiggNavList : ichaingoNavList;
104
107
  const updateUserInfo = useCallback(async () => {
105
108
  try {
106
- const response = await fetch("/api/auth/profile", {
107
- credentials: "include",
108
- cache: "no-store"
109
+ const response = await request.get("/api/auth/profile", {
110
+ baseURL: process.env.AUTH_INNER_API_URL
109
111
  });
110
- if (!response.ok) {
111
- throw new Error(`Failed to load profile: ${response.status}`);
112
- }
113
- const res = await response.json();
114
- setUserInfo(res || {});
112
+ setUserInfo(response.data || {});
115
113
  setUserKey((/* @__PURE__ */ new Date()).getTime().toString());
116
- return res;
114
+ return response;
117
115
  } catch (error) {
118
116
  console.error(error);
119
117
  setUserInfo({});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xchain/header",
3
- "version": "1.1.0-beta.50",
3
+ "version": "1.1.0-beta.51",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -42,19 +42,19 @@
42
42
  "tailwind-merge": "3.3.1"
43
43
  },
44
44
  "dependencies": {
45
- "@0xchain/i18n": "1.1.0-beta.50",
46
- "@0xchain/auth": "1.1.0-beta.50",
47
- "@0xchain/image": "1.1.0-beta.50",
48
- "@0xchain/translation": "1.1.0-beta.50",
49
- "@0xchain/ui": "1.1.0-beta.50",
50
- "@0xchain/link": "1.1.0-beta.50",
51
- "@0xchain/iconfont": "1.1.0-beta.50",
52
- "@0xchain/avatar": "1.1.0-beta.50",
53
- "@0xchain/request": "1.1.0-beta.50",
54
- "@0xchain/better-link": "1.1.0-beta.50",
55
- "@0xchain/with-login": "1.1.0-beta.50",
56
- "@0xchain/theme-toggle": "1.1.0-beta.50",
57
- "@0xchain/tooltip": "1.1.0-beta.50"
45
+ "@0xchain/i18n": "1.1.0-beta.51",
46
+ "@0xchain/auth": "1.1.0-beta.51",
47
+ "@0xchain/avatar": "1.1.0-beta.51",
48
+ "@0xchain/better-link": "1.1.0-beta.51",
49
+ "@0xchain/image": "1.1.0-beta.51",
50
+ "@0xchain/link": "1.1.0-beta.51",
51
+ "@0xchain/translation": "1.1.0-beta.51",
52
+ "@0xchain/ui": "1.1.0-beta.51",
53
+ "@0xchain/theme-toggle": "1.1.0-beta.51",
54
+ "@0xchain/iconfont": "1.1.0-beta.51",
55
+ "@0xchain/request": "1.1.0-beta.51",
56
+ "@0xchain/with-login": "1.1.0-beta.51",
57
+ "@0xchain/tooltip": "1.1.0-beta.51"
58
58
  },
59
59
  "nx": {
60
60
  "tags": [