@blocklet/ui-react 2.12.74 → 2.12.76

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.
@@ -8,7 +8,6 @@ import Box from "@mui/material/Box";
8
8
  import Typography from "@mui/material/Typography";
9
9
  import { useCreation } from "ahooks";
10
10
  import CloseIcon from "@mui/icons-material/Close";
11
- import { useNavigate } from "react-router-dom";
12
11
  import { Icon } from "@iconify/react";
13
12
  import CheckIcon from "@iconify-icons/tabler/circle-check";
14
13
  import WarningIcon from "@iconify-icons/tabler/exclamation-circle";
@@ -130,12 +129,11 @@ const NotificationComponent = forwardRef(
130
129
  setDescription(res);
131
130
  });
132
131
  }, [notification.description]);
133
- const navigate = useNavigate();
134
132
  const onGoNotification = (e) => {
135
133
  e.stopPropagation();
136
134
  closeSnackbar(key);
137
135
  if (!e?.customPreventRedirect) {
138
- navigate(viewAllUrl);
136
+ window.open(viewAllUrl, "_blank");
139
137
  }
140
138
  };
141
139
  const includeActivity = useCreation(() => {
@@ -53,7 +53,7 @@ function UserLink({ user, color = colors.textBase }) {
53
53
  onClick: (e) => {
54
54
  e.customPreventRedirect = true;
55
55
  },
56
- children: user.fullName
56
+ children: user.fullName || "System"
57
57
  }
58
58
  );
59
59
  }
@@ -79,7 +79,7 @@ export default function useActivityTitle({ activity, users, actors, extra = {},
79
79
  return actors.map((actorId) => {
80
80
  if (!actorId)
81
81
  return null;
82
- return usersMap.get(actorId) || { did: actorId, fullName: actorId?.substring(0, 8) };
82
+ return usersMap.get(actorId) || { did: actorId, fullName: "System" };
83
83
  }).filter(Boolean);
84
84
  }, [actors, usersMap]);
85
85
  const formatLinkedUserNames = useMemoizedFn(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/ui-react",
3
- "version": "2.12.74",
3
+ "version": "2.12.76",
4
4
  "description": "Some useful front-end web components that can be used in Blocklets.",
5
5
  "keywords": [
6
6
  "react",
@@ -34,8 +34,8 @@
34
34
  "dependencies": {
35
35
  "@abtnode/constant": "^1.16.41",
36
36
  "@abtnode/util": "^1.16.41",
37
- "@arcblock/bridge": "^2.12.74",
38
- "@arcblock/react-hooks": "^2.12.74",
37
+ "@arcblock/bridge": "^2.12.76",
38
+ "@arcblock/react-hooks": "^2.12.76",
39
39
  "@arcblock/ws": "^1.19.20",
40
40
  "@blocklet/constant": "^1.16.42-beta-20250408-072924-4b6a877a",
41
41
  "@blocklet/did-space-react": "^1.0.46",
@@ -94,5 +94,5 @@
94
94
  "jest": "^29.7.0",
95
95
  "unbuild": "^2.0.0"
96
96
  },
97
- "gitHead": "c426565da690c413a1235552d9fdd3f89c61bebf"
97
+ "gitHead": "15a960186fc10bdaa1c5b4f9d3693010f168d711"
98
98
  }
@@ -8,7 +8,6 @@ import Box from '@mui/material/Box';
8
8
  import Typography from '@mui/material/Typography';
9
9
  import { useCreation } from 'ahooks';
10
10
  import CloseIcon from '@mui/icons-material/Close';
11
- import { useNavigate } from 'react-router-dom';
12
11
  import { Icon, IconifyIcon } from '@iconify/react';
13
12
  import CheckIcon from '@iconify-icons/tabler/circle-check';
14
13
  import WarningIcon from '@iconify-icons/tabler/exclamation-circle';
@@ -167,14 +166,13 @@ const NotificationComponent = forwardRef<HTMLDivElement, NotificationProps>(
167
166
  });
168
167
  }, [notification.description]);
169
168
 
170
- const navigate = useNavigate();
171
169
  const onGoNotification = (e: any) => {
172
170
  e.stopPropagation();
173
171
  closeSnackbar(key);
174
172
 
175
173
  // 已确认 viewAllUrl都是本地的相对地址
176
174
  if (!e?.customPreventRedirect) {
177
- navigate(viewAllUrl);
175
+ window.open(viewAllUrl, '_blank');
178
176
  }
179
177
  };
180
178
 
@@ -75,7 +75,7 @@ function UserLink({ user, color = colors.textBase }: UserLinkProps) {
75
75
  onClick={(e: CustomMouseEvent) => {
76
76
  e.customPreventRedirect = true;
77
77
  }}>
78
- {user.fullName}
78
+ {user.fullName || 'System'}
79
79
  </Link>
80
80
  );
81
81
  }
@@ -139,7 +139,7 @@ export default function useActivityTitle({ activity, users, actors, extra = {},
139
139
  .map((actorId) => {
140
140
  if (!actorId) return null;
141
141
  // If user exists in map, return the user object, otherwise create a basic object with DID
142
- return usersMap.get(actorId) || { did: actorId, fullName: actorId?.substring(0, 8) };
142
+ return usersMap.get(actorId) || { did: actorId, fullName: 'System' };
143
143
  })
144
144
  .filter(Boolean) as UserData[];
145
145
  }, [actors, usersMap]);