@blocklet/ui-react 2.13.21 → 2.13.24
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.
- package/lib/Footer/index.js +2 -0
- package/lib/Footer/internal-footer.js +1 -1
- package/lib/Footer/layout/row.js +2 -2
- package/lib/Footer/layout/standard.js +2 -2
- package/lib/UserCenter/components/nft.js +35 -17
- package/lib/UserCenter/components/user-center.js +15 -4
- package/package.json +6 -6
- package/src/Footer/index.jsx +1 -0
- package/src/Footer/internal-footer.jsx +1 -1
- package/src/Footer/layout/row.jsx +2 -2
- package/src/Footer/layout/standard.jsx +2 -2
- package/src/UserCenter/components/nft.tsx +15 -2
- package/src/UserCenter/components/user-center.tsx +14 -4
package/lib/Footer/index.js
CHANGED
|
@@ -26,6 +26,8 @@ function Footer({ meta, theme: themeOverrides, ...rest }) {
|
|
|
26
26
|
}, [meta]);
|
|
27
27
|
const mergeTheme = useMemo(() => deepmerge(parentTheme, themeOverrides), [parentTheme, themeOverrides]);
|
|
28
28
|
const appLogo = useBlockletLogo({
|
|
29
|
+
key: "xs",
|
|
30
|
+
// 始终优先长 logo
|
|
29
31
|
meta,
|
|
30
32
|
theme: themeOverrides
|
|
31
33
|
});
|
|
@@ -11,7 +11,7 @@ import PlainLayout from "./layout/plain.js";
|
|
|
11
11
|
const layouts = [
|
|
12
12
|
{
|
|
13
13
|
name: "plain",
|
|
14
|
-
// navigation
|
|
14
|
+
// 没有 navigation 和 socialMedia, 使用一个简单的两端对齐布局
|
|
15
15
|
support: (_, data) => !data.navigation?.length && !data.socialMedia?.length,
|
|
16
16
|
component: PlainLayout
|
|
17
17
|
},
|
package/lib/Footer/layout/row.js
CHANGED
|
@@ -27,10 +27,10 @@ const RowRoot = styled(Box)`
|
|
|
27
27
|
margin: 0 auto;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
${(
|
|
30
|
+
${({ theme }) => theme.breakpoints.down("md")} {
|
|
31
31
|
align-items: stretch;
|
|
32
32
|
flex-direction: column;
|
|
33
|
-
gap:
|
|
33
|
+
gap: ${({ theme }) => theme.spacing(1)};
|
|
34
34
|
> * {
|
|
35
35
|
flex: 1 0 100%;
|
|
36
36
|
}
|
|
@@ -18,7 +18,7 @@ function StandardLayout({ elements, data, className, ...rest }) {
|
|
|
18
18
|
paddingRight: { xs: 0, md: 3 },
|
|
19
19
|
display: "flex",
|
|
20
20
|
flexDirection: "column",
|
|
21
|
-
alignItems:
|
|
21
|
+
alignItems: "flex-start",
|
|
22
22
|
gap: 2,
|
|
23
23
|
pb: 3
|
|
24
24
|
},
|
|
@@ -38,7 +38,7 @@ function StandardLayout({ elements, data, className, ...rest }) {
|
|
|
38
38
|
display: "flex",
|
|
39
39
|
flexDirection: { xs: "column", md: "row" },
|
|
40
40
|
justifyContent: "space-between",
|
|
41
|
-
alignItems:
|
|
41
|
+
alignItems: "space-between",
|
|
42
42
|
gap: 2,
|
|
43
43
|
pb: 3
|
|
44
44
|
},
|
|
@@ -58,28 +58,46 @@ export default function Nft({ user }) {
|
|
|
58
58
|
children: t("common.nft")
|
|
59
59
|
}
|
|
60
60
|
),
|
|
61
|
-
/* @__PURE__ */ jsxs(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
61
|
+
/* @__PURE__ */ jsxs(
|
|
62
|
+
Box,
|
|
63
|
+
{
|
|
64
|
+
className: "nft-list-wrapper",
|
|
65
|
+
sx: {
|
|
66
|
+
display: "grid",
|
|
67
|
+
justifyItems: "start",
|
|
68
|
+
gridTemplateColumns: {
|
|
69
|
+
xs: "repeat(2, 1fr)",
|
|
70
|
+
sm: "repeat(2, 1fr)",
|
|
71
|
+
md: "repeat(3, 1fr)",
|
|
72
|
+
lg: "repeat(5, 1fr)"
|
|
73
|
+
},
|
|
74
|
+
gap: 2.5
|
|
75
|
+
},
|
|
76
|
+
children: [
|
|
77
|
+
data?.assets?.map((item) => /* @__PURE__ */ jsx(Box, { width: 166, height: 166, flexShrink: 0, children: /* @__PURE__ */ jsx(
|
|
78
|
+
NFTDisplay,
|
|
79
|
+
{
|
|
80
|
+
data: item.display,
|
|
81
|
+
address: item.address,
|
|
82
|
+
inset: true,
|
|
83
|
+
imageFilter: {
|
|
84
|
+
imageFilter: "resize",
|
|
85
|
+
w: "500",
|
|
86
|
+
f: "webp"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
) }, item.address)),
|
|
90
|
+
data?.assets?.length === 0 && !loading && /* @__PURE__ */ jsx(Box, { display: "flex", justifyContent: "center", alignItems: "center", width: "100%", height: "100%", children: /* @__PURE__ */ jsx(Empty, { children: t("common.noNFT") }) })
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
),
|
|
77
94
|
dataPage.next || paging.page > 1 ? /* @__PURE__ */ jsx(
|
|
78
95
|
Pagination,
|
|
79
96
|
{
|
|
80
97
|
sx: {
|
|
81
98
|
display: "flex",
|
|
82
|
-
justifyContent: "
|
|
99
|
+
justifyContent: "center",
|
|
100
|
+
mt: 2
|
|
83
101
|
},
|
|
84
102
|
page: paging.page,
|
|
85
103
|
onChange: handlePageChange,
|
|
@@ -243,13 +243,13 @@ export default function UserCenter({
|
|
|
243
243
|
);
|
|
244
244
|
}, [userState.data, userCenterTabs, privacyState.data, privacyState.runAsync]);
|
|
245
245
|
const isSettingTab = useCreation(() => {
|
|
246
|
-
return currentActiveTab && currentActiveTab?.value ===
|
|
246
|
+
return currentActiveTab && currentActiveTab?.value === settingsLink;
|
|
247
247
|
}, [currentActiveTab]);
|
|
248
248
|
const isNftsTab = useCreation(() => {
|
|
249
|
-
return currentActiveTab && currentActiveTab?.value === joinURL(PROFILE_URL, "/profile") || currentActiveTab?.value ===
|
|
249
|
+
return currentActiveTab && currentActiveTab?.value === joinURL(PROFILE_URL, "/profile") || currentActiveTab?.value === nftsLink;
|
|
250
250
|
}, [currentActiveTab]);
|
|
251
251
|
const isDidSpaceTab = useCreation(() => {
|
|
252
|
-
return currentActiveTab && currentActiveTab?.value ===
|
|
252
|
+
return currentActiveTab && currentActiveTab?.value === didSpacesLink;
|
|
253
253
|
}, [currentActiveTab]);
|
|
254
254
|
const oauth = session.useOAuth();
|
|
255
255
|
const passkey = session.usePasskey();
|
|
@@ -547,7 +547,18 @@ export default function UserCenter({
|
|
|
547
547
|
content,
|
|
548
548
|
confirmHolder
|
|
549
549
|
] }),
|
|
550
|
-
hideFooter ? null : /* @__PURE__ */ jsx(
|
|
550
|
+
hideFooter ? null : /* @__PURE__ */ jsx(
|
|
551
|
+
Footer,
|
|
552
|
+
{
|
|
553
|
+
bordered: true,
|
|
554
|
+
...footerProps,
|
|
555
|
+
sx: {
|
|
556
|
+
".MuiContainer-root": {
|
|
557
|
+
maxWidth: 1600
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
)
|
|
551
562
|
]
|
|
552
563
|
}
|
|
553
564
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/ui-react",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.24",
|
|
4
4
|
"description": "Some useful front-end web components that can be used in Blocklets.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@abtnode/constant": "^1.16.42",
|
|
36
36
|
"@abtnode/util": "^1.16.42",
|
|
37
|
-
"@arcblock/bridge": "^2.13.
|
|
38
|
-
"@arcblock/react-hooks": "^2.13.
|
|
39
|
-
"@arcblock/ws": "^1.20.
|
|
37
|
+
"@arcblock/bridge": "^2.13.24",
|
|
38
|
+
"@arcblock/react-hooks": "^2.13.24",
|
|
39
|
+
"@arcblock/ws": "^1.20.6",
|
|
40
40
|
"@blocklet/constant": "^1.16.42",
|
|
41
|
-
"@blocklet/did-space-react": "^1.0.
|
|
41
|
+
"@blocklet/did-space-react": "^1.0.51",
|
|
42
42
|
"@iconify-icons/logos": "^1.2.36",
|
|
43
43
|
"@iconify-icons/material-symbols": "^1.2.58",
|
|
44
44
|
"@iconify-icons/tabler": "^1.2.95",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"jest": "^29.7.0",
|
|
95
95
|
"unbuild": "^2.0.0"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "57fa9683f81c72474528412d1a2205dab186f4f9"
|
|
98
98
|
}
|
package/src/Footer/index.jsx
CHANGED
|
@@ -31,6 +31,7 @@ function Footer({ meta, theme: themeOverrides, ...rest }) {
|
|
|
31
31
|
|
|
32
32
|
const mergeTheme = useMemo(() => deepmerge(parentTheme, themeOverrides), [parentTheme, themeOverrides]);
|
|
33
33
|
const appLogo = useBlockletLogo({
|
|
34
|
+
key: 'xs', // 始终优先长 logo
|
|
34
35
|
meta,
|
|
35
36
|
theme: themeOverrides,
|
|
36
37
|
});
|
|
@@ -12,7 +12,7 @@ import PlainLayout from './layout/plain';
|
|
|
12
12
|
const layouts = [
|
|
13
13
|
{
|
|
14
14
|
name: 'plain',
|
|
15
|
-
// navigation
|
|
15
|
+
// 没有 navigation 和 socialMedia, 使用一个简单的两端对齐布局
|
|
16
16
|
support: (_, data) => !data.navigation?.length && !data.socialMedia?.length,
|
|
17
17
|
component: PlainLayout,
|
|
18
18
|
},
|
|
@@ -34,10 +34,10 @@ const RowRoot = styled(Box)`
|
|
|
34
34
|
margin: 0 auto;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
${(
|
|
37
|
+
${({ theme }) => theme.breakpoints.down('md')} {
|
|
38
38
|
align-items: stretch;
|
|
39
39
|
flex-direction: column;
|
|
40
|
-
gap:
|
|
40
|
+
gap: ${({ theme }) => theme.spacing(1)};
|
|
41
41
|
> * {
|
|
42
42
|
flex: 1 0 100%;
|
|
43
43
|
}
|
|
@@ -24,7 +24,7 @@ function StandardLayout({ elements, data, className, ...rest }) {
|
|
|
24
24
|
paddingRight: { xs: 0, md: 3 },
|
|
25
25
|
display: 'flex',
|
|
26
26
|
flexDirection: 'column',
|
|
27
|
-
alignItems:
|
|
27
|
+
alignItems: 'flex-start',
|
|
28
28
|
gap: 2,
|
|
29
29
|
pb: 3,
|
|
30
30
|
}}>
|
|
@@ -42,7 +42,7 @@ function StandardLayout({ elements, data, className, ...rest }) {
|
|
|
42
42
|
display: 'flex',
|
|
43
43
|
flexDirection: { xs: 'column', md: 'row' },
|
|
44
44
|
justifyContent: 'space-between',
|
|
45
|
-
alignItems:
|
|
45
|
+
alignItems: 'space-between',
|
|
46
46
|
gap: 2,
|
|
47
47
|
pb: 3,
|
|
48
48
|
}}>
|
|
@@ -86,7 +86,19 @@ export default function Nft({ user }: { user: User }) {
|
|
|
86
86
|
}}>
|
|
87
87
|
{t('common.nft')}
|
|
88
88
|
</Typography>
|
|
89
|
-
<Box
|
|
89
|
+
<Box
|
|
90
|
+
className="nft-list-wrapper"
|
|
91
|
+
sx={{
|
|
92
|
+
display: 'grid',
|
|
93
|
+
justifyItems: 'start',
|
|
94
|
+
gridTemplateColumns: {
|
|
95
|
+
xs: 'repeat(2, 1fr)',
|
|
96
|
+
sm: 'repeat(2, 1fr)',
|
|
97
|
+
md: 'repeat(3, 1fr)',
|
|
98
|
+
lg: 'repeat(5, 1fr)',
|
|
99
|
+
},
|
|
100
|
+
gap: 2.5,
|
|
101
|
+
}}>
|
|
90
102
|
{data?.assets?.map((item) => (
|
|
91
103
|
<Box key={item.address} width={166} height={166} flexShrink={0}>
|
|
92
104
|
<NFTDisplay
|
|
@@ -111,7 +123,8 @@ export default function Nft({ user }: { user: User }) {
|
|
|
111
123
|
<Pagination
|
|
112
124
|
sx={{
|
|
113
125
|
display: 'flex',
|
|
114
|
-
justifyContent: '
|
|
126
|
+
justifyContent: 'center',
|
|
127
|
+
mt: 2,
|
|
115
128
|
}}
|
|
116
129
|
page={paging.page}
|
|
117
130
|
onChange={handlePageChange}
|
|
@@ -291,18 +291,18 @@ export default function UserCenter({
|
|
|
291
291
|
}, [userState.data, userCenterTabs, privacyState.data, privacyState.runAsync]);
|
|
292
292
|
|
|
293
293
|
const isSettingTab = useCreation(() => {
|
|
294
|
-
return currentActiveTab && currentActiveTab?.value ===
|
|
294
|
+
return currentActiveTab && currentActiveTab?.value === settingsLink;
|
|
295
295
|
}, [currentActiveTab]);
|
|
296
296
|
|
|
297
297
|
const isNftsTab = useCreation(() => {
|
|
298
298
|
return (
|
|
299
299
|
(currentActiveTab && currentActiveTab?.value === joinURL(PROFILE_URL, '/profile')) ||
|
|
300
|
-
currentActiveTab?.value ===
|
|
300
|
+
currentActiveTab?.value === nftsLink
|
|
301
301
|
);
|
|
302
302
|
}, [currentActiveTab]);
|
|
303
303
|
|
|
304
304
|
const isDidSpaceTab = useCreation(() => {
|
|
305
|
-
return currentActiveTab && currentActiveTab?.value ===
|
|
305
|
+
return currentActiveTab && currentActiveTab?.value === didSpacesLink;
|
|
306
306
|
}, [currentActiveTab]);
|
|
307
307
|
|
|
308
308
|
const oauth = session.useOAuth();
|
|
@@ -641,7 +641,17 @@ export default function UserCenter({
|
|
|
641
641
|
{content}
|
|
642
642
|
{confirmHolder}
|
|
643
643
|
</Main>
|
|
644
|
-
{hideFooter ? null :
|
|
644
|
+
{hideFooter ? null : (
|
|
645
|
+
<Footer
|
|
646
|
+
bordered
|
|
647
|
+
{...footerProps}
|
|
648
|
+
sx={{
|
|
649
|
+
'.MuiContainer-root': {
|
|
650
|
+
maxWidth: 1600,
|
|
651
|
+
},
|
|
652
|
+
}}
|
|
653
|
+
/>
|
|
654
|
+
)}
|
|
645
655
|
</Box>
|
|
646
656
|
);
|
|
647
657
|
}
|