@blocklet/ui-react 2.10.20 → 2.10.21
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.
|
@@ -7,6 +7,7 @@ import { SessionContext } from "@arcblock/did-connect/lib/Session";
|
|
|
7
7
|
import Tabs from "@arcblock/ux/lib/Tabs";
|
|
8
8
|
import Empty from "@arcblock/ux/lib/Empty";
|
|
9
9
|
import Button from "@arcblock/ux/lib/Button";
|
|
10
|
+
import Result from "@arcblock/ux/lib/Result";
|
|
10
11
|
import { temp as colors } from "@arcblock/ux/lib/Colors";
|
|
11
12
|
import { useConfirm } from "@arcblock/ux/lib/Dialog";
|
|
12
13
|
import { translate } from "@arcblock/ux/lib/Locale/util";
|
|
@@ -186,6 +187,10 @@ export default function UserCenter({
|
|
|
186
187
|
return null;
|
|
187
188
|
}
|
|
188
189
|
if (userState.error) {
|
|
190
|
+
const errorStatus = userState.error?.response?.status;
|
|
191
|
+
if (errorStatus === 404) {
|
|
192
|
+
return /* @__PURE__ */ jsx(Box, { sx: { width: "100%" }, children: /* @__PURE__ */ jsx(Result, { status: 404, description: t("noUserFound") }) });
|
|
193
|
+
}
|
|
189
194
|
const errorMessage = userState.error.response?.data?.error || userState.error.message || "error occurred";
|
|
190
195
|
const formatError = {
|
|
191
196
|
message: errorMessage
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/ui-react",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.21",
|
|
4
4
|
"description": "Some useful front-end web components that can be used in Blocklets.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"url": "https://github.com/ArcBlock/ux/issues"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@arcblock/bridge": "^2.10.
|
|
36
|
-
"@arcblock/react-hooks": "^2.10.
|
|
35
|
+
"@arcblock/bridge": "^2.10.21",
|
|
36
|
+
"@arcblock/react-hooks": "^2.10.21",
|
|
37
37
|
"@iconify-icons/logos": "^1.2.36",
|
|
38
38
|
"@iconify-icons/material-symbols": "^1.2.58",
|
|
39
39
|
"@iconify/react": "^4.1.1",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"jest": "^28.1.3",
|
|
80
80
|
"unbuild": "^2.0.0"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "949068dfafbd2bff9933a2fc2a48d1cd90db491b"
|
|
83
83
|
}
|
|
@@ -8,6 +8,7 @@ import { SessionContext } from '@arcblock/did-connect/lib/Session';
|
|
|
8
8
|
import Tabs from '@arcblock/ux/lib/Tabs';
|
|
9
9
|
import Empty from '@arcblock/ux/lib/Empty';
|
|
10
10
|
import Button from '@arcblock/ux/lib/Button';
|
|
11
|
+
import Result from '@arcblock/ux/lib/Result';
|
|
11
12
|
import { temp as colors } from '@arcblock/ux/lib/Colors';
|
|
12
13
|
import { useConfirm } from '@arcblock/ux/lib/Dialog';
|
|
13
14
|
import { translate } from '@arcblock/ux/lib/Locale/util';
|
|
@@ -221,6 +222,15 @@ export default function UserCenter({
|
|
|
221
222
|
return null;
|
|
222
223
|
}
|
|
223
224
|
if (userState.error) {
|
|
225
|
+
const errorStatus = (userState.error as AxiosError<{ error: string }>)?.response?.status;
|
|
226
|
+
if (errorStatus === 404) {
|
|
227
|
+
return (
|
|
228
|
+
<Box sx={{ width: '100%' }}>
|
|
229
|
+
<Result status={404} description={t('noUserFound')} />
|
|
230
|
+
</Box>
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
|
|
224
234
|
const errorMessage =
|
|
225
235
|
(userState.error as AxiosError<{ error: string }>).response?.data?.error ||
|
|
226
236
|
userState.error.message ||
|