@blocklet/ui-react 2.4.61 → 2.4.63

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.
@@ -73,22 +73,21 @@ function HeaderAddons(_ref) {
73
73
 
74
74
  const menu = [];
75
75
 
76
- if (authenticated && (_localizedNav = localizedNav) !== null && _localizedNav !== void 0 && _localizedNav.length) {
77
- localizedNav.forEach(item => {
78
- menu.push({
79
- label: item.title,
80
- icon: item.icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
81
- className: "iconify",
82
- "data-icon": item.icon,
83
- "data-height": "24",
84
- style: {
85
- marginRight: 16
86
- }
87
- }) : null,
88
- component: 'a',
89
- href: item.link,
90
- key: item.link
91
- });
76
+ if (authenticated && (_localizedNav = localizedNav) !== null && _localizedNav !== void 0 && _localizedNav[0]) {
77
+ const firstItem = localizedNav[0];
78
+ menu.push({
79
+ label: firstItem.title,
80
+ icon: firstItem.icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
81
+ className: "iconify",
82
+ "data-icon": firstItem.icon,
83
+ "data-height": "24",
84
+ style: {
85
+ marginRight: 16
86
+ }
87
+ }) : null,
88
+ component: 'a',
89
+ href: firstItem.link,
90
+ key: firstItem.link
92
91
  });
93
92
  }
94
93
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/ui-react",
3
- "version": "2.4.61",
3
+ "version": "2.4.63",
4
4
  "description": "Some useful front-end web components that can be used in Blocklets.",
5
5
  "keywords": [
6
6
  "react",
@@ -30,8 +30,8 @@
30
30
  "url": "https://github.com/ArcBlock/ux/issues"
31
31
  },
32
32
  "dependencies": {
33
- "@arcblock/did-connect": "^2.4.61",
34
- "@arcblock/ux": "^2.4.61",
33
+ "@arcblock/did-connect": "^2.4.63",
34
+ "@arcblock/ux": "^2.4.63",
35
35
  "@emotion/react": "^11.10.4",
36
36
  "@emotion/styled": "^11.10.4",
37
37
  "@iconify/iconify": "^2.2.1",
@@ -53,5 +53,5 @@
53
53
  "eslint-plugin-react-hooks": "^4.6.0",
54
54
  "jest": "^28.1.3"
55
55
  },
56
- "gitHead": "ebe5ad48fd13a0e853905a47b7884171ef26e351"
56
+ "gitHead": "bb8de85b766080329391750b6ea21386d1e2f3fb"
57
57
  }
@@ -32,17 +32,16 @@ export default function HeaderAddons({ formattedBlocklet, addons, sessionManager
32
32
  // 启用了连接钱包并且检测到了 session context
33
33
  if (enableConnect && sessionCtx) {
34
34
  const menu = [];
35
- if (authenticated && localizedNav?.length) {
36
- localizedNav.forEach((item) => {
37
- menu.push({
38
- label: item.title,
39
- icon: item.icon ? (
40
- <span className="iconify" data-icon={item.icon} data-height="24" style={{ marginRight: 16 }} />
41
- ) : null,
42
- component: 'a',
43
- href: item.link,
44
- key: item.link,
45
- });
35
+ if (authenticated && localizedNav?.[0]) {
36
+ const firstItem = localizedNav[0];
37
+ menu.push({
38
+ label: firstItem.title,
39
+ icon: firstItem.icon ? (
40
+ <span className="iconify" data-icon={firstItem.icon} data-height="24" style={{ marginRight: 16 }} />
41
+ ) : null,
42
+ component: 'a',
43
+ href: firstItem.link,
44
+ key: firstItem.link,
46
45
  });
47
46
  }
48
47
  addonsArray.push(