@blocklet/ui-react 2.7.14 → 2.7.16

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.
@@ -44,20 +44,22 @@ export default function HeaderAddons({
44
44
  // 启用了连接钱包并且检测到了 session context
45
45
  if (enableConnect && sessionCtx) {
46
46
  const menu = [];
47
- if (authenticated && localizedNav?.[0]) {
48
- const firstItem = localizedNav[0];
49
- menu.push({
50
- label: firstItem.title,
51
- icon: firstItem.icon ? /*#__PURE__*/_jsx("iconify-icon", {
52
- icon: firstItem.icon,
53
- height: 24,
54
- style: {
55
- marginRight: 16
56
- }
57
- }) : null,
58
- component: 'a',
59
- href: firstItem.link,
60
- key: firstItem.link
47
+ if (authenticated) {
48
+ const navList = localizedNav ? localizedNav.slice(0, 5) : [];
49
+ navList.forEach(x => {
50
+ menu.push({
51
+ label: x.title,
52
+ icon: x.icon ? /*#__PURE__*/_jsx("iconify-icon", {
53
+ icon: x.icon,
54
+ height: 24,
55
+ style: {
56
+ marginRight: 8
57
+ }
58
+ }) : null,
59
+ component: 'a',
60
+ href: x.link,
61
+ key: x.link
62
+ });
61
63
  });
62
64
  }
63
65
  addonsArray.push( /*#__PURE__*/_jsx(SessionManager, {
@@ -54,22 +54,23 @@ function HeaderAddons(_ref) {
54
54
  }
55
55
  // 启用了连接钱包并且检测到了 session context
56
56
  if (enableConnect && sessionCtx) {
57
- var _localizedNav;
58
57
  const menu = [];
59
- if (authenticated && (_localizedNav = localizedNav) !== null && _localizedNav !== void 0 && _localizedNav[0]) {
60
- const firstItem = localizedNav[0];
61
- menu.push({
62
- label: firstItem.title,
63
- icon: firstItem.icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)("iconify-icon", {
64
- icon: firstItem.icon,
65
- height: 24,
66
- style: {
67
- marginRight: 16
68
- }
69
- }) : null,
70
- component: 'a',
71
- href: firstItem.link,
72
- key: firstItem.link
58
+ if (authenticated) {
59
+ const navList = localizedNav ? localizedNav.slice(0, 5) : [];
60
+ navList.forEach(x => {
61
+ menu.push({
62
+ label: x.title,
63
+ icon: x.icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)("iconify-icon", {
64
+ icon: x.icon,
65
+ height: 24,
66
+ style: {
67
+ marginRight: 8
68
+ }
69
+ }) : null,
70
+ component: 'a',
71
+ href: x.link,
72
+ key: x.link
73
+ });
73
74
  });
74
75
  }
75
76
  addonsArray.push( /*#__PURE__*/(0, _jsxRuntime.jsx)(_SessionManager.default, _objectSpread({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/ui-react",
3
- "version": "2.7.14",
3
+ "version": "2.7.16",
4
4
  "description": "Some useful front-end web components that can be used in Blocklets.",
5
5
  "keywords": [
6
6
  "react",
@@ -61,8 +61,8 @@
61
61
  }
62
62
  },
63
63
  "dependencies": {
64
- "@arcblock/did-connect": "^2.7.14",
65
- "@arcblock/ux": "^2.7.14",
64
+ "@arcblock/did-connect": "^2.7.16",
65
+ "@arcblock/ux": "^2.7.16",
66
66
  "@emotion/react": "^11.10.4",
67
67
  "@emotion/styled": "^11.10.4",
68
68
  "@mui/material": "^5.10.8",
@@ -85,5 +85,5 @@
85
85
  "glob": "^10.3.3",
86
86
  "jest": "^28.1.3"
87
87
  },
88
- "gitHead": "bdb3657628085f18d46bca6769f62074d06f54d3"
88
+ "gitHead": "8adb844a1067ecca748cd70c5978c9f7497e3658"
89
89
  }
@@ -34,14 +34,16 @@ export default function HeaderAddons({ formattedBlocklet, addons, sessionManager
34
34
  // 启用了连接钱包并且检测到了 session context
35
35
  if (enableConnect && sessionCtx) {
36
36
  const menu = [];
37
- if (authenticated && localizedNav?.[0]) {
38
- const firstItem = localizedNav[0];
39
- menu.push({
40
- label: firstItem.title,
41
- icon: firstItem.icon ? <iconify-icon icon={firstItem.icon} height={24} style={{ marginRight: 16 }} /> : null,
42
- component: 'a',
43
- href: firstItem.link,
44
- key: firstItem.link,
37
+ if (authenticated) {
38
+ const navList = localizedNav ? localizedNav.slice(0, 5) : [];
39
+ navList.forEach((x) => {
40
+ menu.push({
41
+ label: x.title,
42
+ icon: x.icon ? <iconify-icon icon={x.icon} height={24} style={{ marginRight: 8 }} /> : null,
43
+ component: 'a',
44
+ href: x.link,
45
+ key: x.link,
46
+ });
45
47
  });
46
48
  }
47
49
  addonsArray.push(
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes