@blocklet/ui-react 2.11.3 → 2.11.4
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.
|
@@ -14,7 +14,7 @@ import { translate } from "@arcblock/ux/lib/Locale/util";
|
|
|
14
14
|
import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
|
|
15
15
|
import { ErrorFallback } from "@arcblock/ux/lib/ErrorBoundary";
|
|
16
16
|
import cloneDeep from "lodash/cloneDeep";
|
|
17
|
-
import { getQuery, withQuery, joinURL } from "ufo";
|
|
17
|
+
import { getQuery, withQuery, joinURL, withoutTrailingSlash } from "ufo";
|
|
18
18
|
import { PROFILE_URL } from "@arcblock/ux/lib/Util/constant";
|
|
19
19
|
import Footer from "../../Footer/index.js";
|
|
20
20
|
import Header from "../../Header/index.js";
|
|
@@ -157,7 +157,7 @@ export default function UserCenter({
|
|
|
157
157
|
}).filter((x) => isMyself || !x.isPrivate);
|
|
158
158
|
}, [formattedBlocklet, userState.data, privacyState?.data, locale, defaultTabs, isMyself]);
|
|
159
159
|
const currentActiveTab = useCreation(() => {
|
|
160
|
-
return userCenterTabs.find((x) => x.value === currentTab);
|
|
160
|
+
return userCenterTabs.find((x) => withoutTrailingSlash(x.value) === withoutTrailingSlash(currentTab));
|
|
161
161
|
}, [userCenterTabs]);
|
|
162
162
|
const handleChangeTab = useMemoizedFn((value) => {
|
|
163
163
|
const findTab = userCenterTabs.find((x) => x.value === value);
|
|
@@ -198,10 +198,6 @@ export default function UserCenter({
|
|
|
198
198
|
Box,
|
|
199
199
|
{
|
|
200
200
|
sx: {
|
|
201
|
-
width: {
|
|
202
|
-
sx: "100%",
|
|
203
|
-
md: 420
|
|
204
|
-
},
|
|
205
201
|
maxWidth: "100%",
|
|
206
202
|
position: "relative"
|
|
207
203
|
},
|
|
@@ -322,7 +318,7 @@ export default function UserCenter({
|
|
|
322
318
|
orientation: isMobile ? "horizontal" : "vertical",
|
|
323
319
|
variant: "line",
|
|
324
320
|
tabs: userCenterTabs,
|
|
325
|
-
current: currentTab,
|
|
321
|
+
current: currentActiveTab?.value ?? currentTab,
|
|
326
322
|
onChange: handleChangeTab,
|
|
327
323
|
sx: {
|
|
328
324
|
width: isMobile ? "100%" : 180,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/ui-react",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.4",
|
|
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.11.
|
|
36
|
-
"@arcblock/react-hooks": "^2.11.
|
|
35
|
+
"@arcblock/bridge": "^2.11.4",
|
|
36
|
+
"@arcblock/react-hooks": "^2.11.4",
|
|
37
37
|
"@blocklet/did-space-react": "^0.5.83",
|
|
38
38
|
"@iconify-icons/logos": "^1.2.36",
|
|
39
39
|
"@iconify-icons/material-symbols": "^1.2.58",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"jest": "^29.7.0",
|
|
81
81
|
"unbuild": "^2.0.0"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "4c757dc656bb78a677c33a4db12567c5bd56ccf6"
|
|
84
84
|
}
|
|
@@ -15,7 +15,7 @@ import { translate } from '@arcblock/ux/lib/Locale/util';
|
|
|
15
15
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
16
16
|
import { ErrorFallback } from '@arcblock/ux/lib/ErrorBoundary';
|
|
17
17
|
import cloneDeep from 'lodash/cloneDeep';
|
|
18
|
-
import { getQuery, withQuery, joinURL } from 'ufo';
|
|
18
|
+
import { getQuery, withQuery, joinURL, withoutTrailingSlash } from 'ufo';
|
|
19
19
|
import type { AxiosError } from 'axios';
|
|
20
20
|
import type { UserPublicInfo } from '@blocklet/js-sdk';
|
|
21
21
|
|
|
@@ -190,7 +190,7 @@ export default function UserCenter({
|
|
|
190
190
|
}, [formattedBlocklet, userState.data, privacyState?.data, locale, defaultTabs, isMyself]);
|
|
191
191
|
|
|
192
192
|
const currentActiveTab = useCreation(() => {
|
|
193
|
-
return userCenterTabs.find((x) => x.value === currentTab);
|
|
193
|
+
return userCenterTabs.find((x) => withoutTrailingSlash(x.value) === withoutTrailingSlash(currentTab));
|
|
194
194
|
}, [userCenterTabs]);
|
|
195
195
|
|
|
196
196
|
const handleChangeTab = useMemoizedFn((value) => {
|
|
@@ -235,10 +235,6 @@ export default function UserCenter({
|
|
|
235
235
|
return (
|
|
236
236
|
<Box
|
|
237
237
|
sx={{
|
|
238
|
-
width: {
|
|
239
|
-
sx: '100%',
|
|
240
|
-
md: 420,
|
|
241
|
-
},
|
|
242
238
|
maxWidth: '100%',
|
|
243
239
|
position: 'relative',
|
|
244
240
|
}}>
|
|
@@ -364,7 +360,7 @@ export default function UserCenter({
|
|
|
364
360
|
orientation={isMobile ? 'horizontal' : 'vertical'}
|
|
365
361
|
variant="line"
|
|
366
362
|
tabs={userCenterTabs}
|
|
367
|
-
current={currentTab}
|
|
363
|
+
current={currentActiveTab?.value ?? currentTab}
|
|
368
364
|
onChange={handleChangeTab}
|
|
369
365
|
sx={{
|
|
370
366
|
width: isMobile ? '100%' : 180,
|