@blocklet/ui-react 2.11.15 → 2.11.16

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.
@@ -64,7 +64,7 @@ export default function Settings({
64
64
  {
65
65
  label: t("sessionManagement"),
66
66
  value: "session",
67
- content: /* @__PURE__ */ jsx(UserSessions, { user })
67
+ content: /* @__PURE__ */ jsx(UserSessions, { user, showUser: false })
68
68
  }
69
69
  ].filter(Boolean);
70
70
  }, [user, privacyConfigList]);
@@ -40,7 +40,7 @@ export default function UserCenter({
40
40
  stickySidebar = false
41
41
  }) {
42
42
  const { locale } = useLocaleContext();
43
- const isMobile = useMobile({});
43
+ const isMobile = useMobile({ key: "md" });
44
44
  const t = useMemoizedFn((key, data = {}) => {
45
45
  return translate(translations, key, locale, "en", data);
46
46
  });
@@ -10,9 +10,10 @@ import { getVisitorId } from "@arcblock/ux/lib/Util";
10
10
  import { useConfirm } from "@arcblock/ux/lib/Dialog";
11
11
  import pAll from "p-all";
12
12
  import PQueue from "p-queue";
13
- import { Box, Button, CircularProgress, Tooltip, Typography } from "@mui/material";
13
+ import { Box, Button, CircularProgress, Tooltip, Typography, useMediaQuery } from "@mui/material";
14
14
  import { memo, useContext, useEffect } from "react";
15
15
  import { SessionContext } from "@arcblock/did-connect/lib/Session";
16
+ import useMobile from "../../hooks/use-mobile.js";
16
17
  import UserSessionInfo from "./user-session-info.js";
17
18
  import { client } from "../../libs/client.js";
18
19
  import { translations } from "../libs/locales.js";
@@ -57,6 +58,8 @@ export default function UserSessions({
57
58
  const { session } = useContext(SessionContext);
58
59
  const currentVisitorId = getVisitorId();
59
60
  const { locale } = useLocaleContext();
61
+ const isMobile = useMobile({ key: "md" });
62
+ const isLg = useMediaQuery((theme) => theme.breakpoints.down("lg"));
60
63
  const { confirmApi, confirmHolder } = useConfirm();
61
64
  const t = useMemoizedFn((key, data = {}) => {
62
65
  return translate(translations, key, locale, "en", data);
@@ -257,7 +260,7 @@ export default function UserSessions({
257
260
  Box,
258
261
  {
259
262
  sx: {
260
- maxWidth: 920,
263
+ maxWidth: isMobile ? "unset" : isLg ? "calc(100vw - 300px)" : "920px",
261
264
  ".MuiTableCell-head": {
262
265
  whiteSpace: "nowrap",
263
266
  fontWeight: "bold"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/ui-react",
3
- "version": "2.11.15",
3
+ "version": "2.11.16",
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.15",
36
- "@arcblock/react-hooks": "^2.11.15",
35
+ "@arcblock/bridge": "^2.11.16",
36
+ "@arcblock/react-hooks": "^2.11.16",
37
37
  "@blocklet/did-space-react": "^0.6.0",
38
38
  "@iconify-icons/logos": "^1.2.36",
39
39
  "@iconify-icons/material-symbols": "^1.2.58",
@@ -81,5 +81,5 @@
81
81
  "jest": "^29.7.0",
82
82
  "unbuild": "^2.0.0"
83
83
  },
84
- "gitHead": "08b1daa5c17ade28952f1c44fb4e6f79f1c3b178"
84
+ "gitHead": "1216fcd112e02c4135f5d748fe002cafaaebcfd9"
85
85
  }
@@ -77,7 +77,7 @@ export default function Settings({
77
77
  {
78
78
  label: t('sessionManagement'),
79
79
  value: 'session',
80
- content: <UserSessions user={user} />,
80
+ content: <UserSessions user={user} showUser={false} />,
81
81
  },
82
82
  ].filter(Boolean);
83
83
  }, [user, privacyConfigList]);
@@ -61,7 +61,7 @@ export default function UserCenter({
61
61
  readonly stickySidebar?: boolean;
62
62
  }) {
63
63
  const { locale } = useLocaleContext();
64
- const isMobile = useMobile({});
64
+ const isMobile = useMobile({ key: 'md' });
65
65
  const t = useMemoizedFn((key, data = {}) => {
66
66
  return translate(translations, key, locale, 'en', data);
67
67
  });
@@ -11,11 +11,12 @@ import { getVisitorId } from '@arcblock/ux/lib/Util';
11
11
  import { useConfirm } from '@arcblock/ux/lib/Dialog';
12
12
  import pAll from 'p-all';
13
13
  import PQueue from 'p-queue';
14
- import { Box, Button, CircularProgress, Tooltip, Typography } from '@mui/material';
14
+ import { Box, Button, CircularProgress, Tooltip, Typography, useMediaQuery } from '@mui/material';
15
15
  import { memo, ReactElement, useContext, useEffect } from 'react';
16
16
  import { UserSession } from '@blocklet/js-sdk';
17
17
  import { SessionContext } from '@arcblock/did-connect/lib/Session';
18
18
 
19
+ import useMobile from '../../hooks/use-mobile';
19
20
  import UserSessionInfo from './user-session-info';
20
21
  import { User, SessionContext as TSessionContext } from '../../@types';
21
22
  import { client } from '../../libs/client';
@@ -88,6 +89,8 @@ export default function UserSessions({
88
89
  const { session } = useContext<TSessionContext>(SessionContext);
89
90
  const currentVisitorId = getVisitorId();
90
91
  const { locale } = useLocaleContext();
92
+ const isMobile = useMobile({ key: 'md' });
93
+ const isLg = useMediaQuery((theme: any) => theme.breakpoints.down('lg'));
91
94
  const { confirmApi, confirmHolder } = useConfirm();
92
95
  const t = useMemoizedFn((key, data = {}) => {
93
96
  return translate(translations, key, locale, 'en', data);
@@ -308,7 +311,7 @@ export default function UserSessions({
308
311
  return (
309
312
  <Box
310
313
  sx={{
311
- maxWidth: 920,
314
+ maxWidth: isMobile ? 'unset' : isLg ? 'calc(100vw - 300px)' : '920px',
312
315
  '.MuiTableCell-head': {
313
316
  whiteSpace: 'nowrap',
314
317
  fontWeight: 'bold',