@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.
- package/dist/lib/Nav.js +8 -10
- 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
|
|
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
|
|
107
|
-
|
|
108
|
-
cache: "no-store"
|
|
109
|
+
const response = await request.get("/api/auth/profile", {
|
|
110
|
+
baseURL: process.env.AUTH_INNER_API_URL
|
|
109
111
|
});
|
|
110
|
-
|
|
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
|
|
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.
|
|
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.
|
|
46
|
-
"@0xchain/auth": "1.1.0-beta.
|
|
47
|
-
"@0xchain/
|
|
48
|
-
"@0xchain/
|
|
49
|
-
"@0xchain/
|
|
50
|
-
"@0xchain/link": "1.1.0-beta.
|
|
51
|
-
"@0xchain/
|
|
52
|
-
"@0xchain/
|
|
53
|
-
"@0xchain/
|
|
54
|
-
"@0xchain/
|
|
55
|
-
"@0xchain/
|
|
56
|
-
"@0xchain/
|
|
57
|
-
"@0xchain/tooltip": "1.1.0-beta.
|
|
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": [
|