@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.
@@ -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
  },
@@ -27,10 +27,10 @@ const RowRoot = styled(Box)`
27
27
  margin: 0 auto;
28
28
  }
29
29
 
30
- ${(props) => props.theme.breakpoints.down("md")} {
30
+ ${({ theme }) => theme.breakpoints.down("md")} {
31
31
  align-items: stretch;
32
32
  flex-direction: column;
33
- gap: 16px;
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: { xs: "center", md: "flex-start" },
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: { xs: "center", md: "space-between" },
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(Box, { className: "nft-list-wrapper", display: "flex", flexDirection: "row", gap: 2, flexWrap: "wrap", children: [
62
- data?.assets?.map((item) => /* @__PURE__ */ jsx(Box, { width: 166, height: 166, flexShrink: 0, children: /* @__PURE__ */ jsx(
63
- NFTDisplay,
64
- {
65
- data: item.display,
66
- address: item.address,
67
- inset: true,
68
- imageFilter: {
69
- imageFilter: "resize",
70
- w: "500",
71
- f: "webp"
72
- }
73
- }
74
- ) }, item.address)),
75
- 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") }) })
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: "end"
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 === joinURL(PROFILE_URL, "/settings");
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 === joinURL(PROFILE_URL, "/nfts");
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 === joinURL(PROFILE_URL, "/did-spaces");
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(Footer, { bordered: true, ...footerProps })
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.21",
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.21",
38
- "@arcblock/react-hooks": "^2.13.21",
39
- "@arcblock/ws": "^1.20.4",
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.49",
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": "ff25dbcf651ad7e8c0b940525e285f2cebe3e52d"
97
+ "gitHead": "57fa9683f81c72474528412d1a2205dab186f4f9"
98
98
  }
@@ -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
- ${(props) => props.theme.breakpoints.down('md')} {
37
+ ${({ theme }) => theme.breakpoints.down('md')} {
38
38
  align-items: stretch;
39
39
  flex-direction: column;
40
- gap: 16px;
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: { xs: 'center', md: 'flex-start' },
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: { xs: 'center', md: 'space-between' },
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 className="nft-list-wrapper" display="flex" flexDirection="row" gap={2} flexWrap="wrap">
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: 'end',
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 === joinURL(PROFILE_URL, '/settings');
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 === joinURL(PROFILE_URL, '/nfts')
300
+ currentActiveTab?.value === nftsLink
301
301
  );
302
302
  }, [currentActiveTab]);
303
303
 
304
304
  const isDidSpaceTab = useCreation(() => {
305
- return currentActiveTab && currentActiveTab?.value === joinURL(PROFILE_URL, '/did-spaces');
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 : <Footer bordered {...footerProps} />}
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
  }