@blocklet/ui-react 2.9.23 → 2.9.25

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.
Files changed (35) hide show
  1. package/es/Footer/index.js +12 -2
  2. package/es/Header/index.js +5 -1
  3. package/es/UserCenter/components/passport.d.ts +2 -2
  4. package/es/UserCenter/components/passport.js +44 -29
  5. package/es/UserCenter/components/user-basic-info.d.ts +3 -2
  6. package/es/UserCenter/components/user-basic-info.js +6 -11
  7. package/es/UserCenter/components/user-center.d.ts +2 -2
  8. package/es/UserCenter/components/user-center.js +160 -100
  9. package/es/UserCenter/components/user-info-item.js +12 -21
  10. package/es/UserCenter/components/user-info.d.ts +2 -2
  11. package/es/UserCenter/components/user-info.js +13 -16
  12. package/es/UserCenter/libs/locales.d.ts +6 -0
  13. package/es/UserCenter/libs/locales.js +8 -2
  14. package/lib/Footer/index.js +7 -2
  15. package/lib/Header/index.js +7 -1
  16. package/lib/UserCenter/components/passport.d.ts +2 -2
  17. package/lib/UserCenter/components/passport.js +17 -10
  18. package/lib/UserCenter/components/user-basic-info.d.ts +3 -2
  19. package/lib/UserCenter/components/user-basic-info.js +8 -11
  20. package/lib/UserCenter/components/user-center.d.ts +2 -2
  21. package/lib/UserCenter/components/user-center.js +135 -95
  22. package/lib/UserCenter/components/user-info-item.js +8 -16
  23. package/lib/UserCenter/components/user-info.d.ts +2 -2
  24. package/lib/UserCenter/components/user-info.js +18 -17
  25. package/lib/UserCenter/libs/locales.d.ts +6 -0
  26. package/lib/UserCenter/libs/locales.js +8 -2
  27. package/package.json +6 -6
  28. package/src/Footer/index.jsx +9 -3
  29. package/src/Header/index.jsx +6 -2
  30. package/src/UserCenter/components/passport.tsx +23 -9
  31. package/src/UserCenter/components/user-basic-info.tsx +8 -12
  32. package/src/UserCenter/components/user-center.tsx +147 -101
  33. package/src/UserCenter/components/user-info-item.tsx +6 -14
  34. package/src/UserCenter/components/user-info.tsx +18 -25
  35. package/src/UserCenter/libs/locales.ts +7 -1
@@ -6,6 +6,8 @@ export declare const translations: {
6
6
  notification: string;
7
7
  email: string;
8
8
  lastLogin: string;
9
+ lastLoginAt: string;
10
+ lastLoginIp: string;
9
11
  createdAt: string;
10
12
  registerFrom: string;
11
13
  unknown: string;
@@ -36,6 +38,7 @@ export declare const translations: {
36
38
  currentPassport: string;
37
39
  switchProfile: string;
38
40
  userInfo: string;
41
+ myInfo: string;
39
42
  };
40
43
  en: {
41
44
  settings: string;
@@ -44,6 +47,8 @@ export declare const translations: {
44
47
  notification: string;
45
48
  email: string;
46
49
  lastLogin: string;
50
+ lastLoginAt: string;
51
+ lastLoginIp: string;
47
52
  createdAt: string;
48
53
  registerFrom: string;
49
54
  unknown: string;
@@ -74,5 +79,6 @@ export declare const translations: {
74
79
  currentPassport: string;
75
80
  switchProfile: string;
76
81
  userInfo: string;
82
+ myInfo: string;
77
83
  };
78
84
  };
@@ -6,6 +6,8 @@ export const translations = {
6
6
  notification: "\u901A\u77E5",
7
7
  email: "\u90AE\u7BB1\u5730\u5740",
8
8
  lastLogin: "\u4E0A\u6B21\u767B\u5F55",
9
+ lastLoginAt: "\u4E0A\u6B21\u767B\u5F55\u65F6\u95F4",
10
+ lastLoginIp: "\u4E0A\u6B21\u767B\u5F55\u5730\u5740",
9
11
  createdAt: "\u521B\u5EFA\u65F6\u95F4",
10
12
  registerFrom: "\u6CE8\u518C\u6765\u6E90",
11
13
  unknown: "\u672A\u77E5",
@@ -35,7 +37,8 @@ export const translations = {
35
37
  toPublic: "\u516C\u5F00 \u201C{name}\u201D \u9875\u9762",
36
38
  currentPassport: "\u5F53\u524D\u4F7F\u7528\u7684\u901A\u884C\u8BC1",
37
39
  switchProfile: "\u5207\u6362",
38
- userInfo: "\u4E2A\u4EBA\u4FE1\u606F"
40
+ userInfo: "\u4E2A\u4EBA\u4FE1\u606F",
41
+ myInfo: "\u6211\u7684\u4FE1\u606F"
39
42
  },
40
43
  en: {
41
44
  settings: "Settings",
@@ -44,6 +47,8 @@ export const translations = {
44
47
  notification: "Notification",
45
48
  email: "Email",
46
49
  lastLogin: "Last Login & IP",
50
+ lastLoginAt: "Last Login",
51
+ lastLoginIp: "Last IP",
47
52
  createdAt: "Created At",
48
53
  registerFrom: "Register From",
49
54
  unknown: "Unknown",
@@ -73,6 +78,7 @@ export const translations = {
73
78
  toPublic: 'Public "{name}" page',
74
79
  currentPassport: "Passport currently in use",
75
80
  switchProfile: "Switch",
76
- userInfo: "User Info"
81
+ userInfo: "User Info",
82
+ myInfo: "My Info"
77
83
  }
78
84
  };
@@ -11,6 +11,8 @@ var _Theme = require("@arcblock/ux/lib/Theme");
11
11
  var _reactErrorBoundary = require("react-error-boundary");
12
12
  var _context = require("@arcblock/ux/lib/Locale/context");
13
13
  var _ErrorBoundary = require("@arcblock/ux/lib/ErrorBoundary");
14
+ var _Colors = require("@arcblock/ux/lib/Colors");
15
+ var _omit = _interopRequireDefault(require("lodash/omit"));
14
16
  var _overridableThemeProvider = _interopRequireDefault(require("../common/overridable-theme-provider"));
15
17
  var _internalFooter = _interopRequireDefault(require("./internal-footer"));
16
18
  var _utils = require("../utils");
@@ -73,7 +75,8 @@ function Footer({
73
75
  theme: themeOverrides,
74
76
  children: /* @__PURE__ */(0, _jsxRuntime.jsx)(StyledInternalFooter, {
75
77
  ...props,
76
- ...rest,
78
+ ...(0, _omit.default)(rest, ["bordered"]),
79
+ $bordered: rest?.bordered,
77
80
  $bgcolor: theme?.background?.footer
78
81
  })
79
82
  });
@@ -88,7 +91,9 @@ Footer.defaultProps = {
88
91
  theme: null
89
92
  };
90
93
  const StyledInternalFooter = (0, _Theme.styled)(_internalFooter.default)`
91
- border-top: 1px solid #eee;
94
+ ${({
95
+ $bordered
96
+ }) => `border-top: 1px solid ${$bordered ? _Colors.temp.strokeSep : "#eee"};`}
92
97
  color: ${props => props.theme.palette.grey[600]};
93
98
  ${({
94
99
  $bgcolor
@@ -13,6 +13,8 @@ var _Theme = require("@arcblock/ux/lib/Theme");
13
13
  var _Header = require("@arcblock/ux/lib/Header");
14
14
  var _NavMenu = _interopRequireDefault(require("@arcblock/ux/lib/NavMenu"));
15
15
  var _context = require("@arcblock/ux/lib/Locale/context");
16
+ var _Colors = require("@arcblock/ux/lib/Colors");
17
+ var _omit = _interopRequireDefault(require("lodash/omit"));
16
18
  var _Icon = _interopRequireDefault(require("../Icon"));
17
19
  var _overridableThemeProvider = _interopRequireDefault(require("../common/overridable-theme-provider"));
18
20
  var _types = require("../types");
@@ -119,7 +121,8 @@ function Header({
119
121
  alt: "logo"
120
122
  }),
121
123
  addons: headerAddons,
122
- ...rest,
124
+ ...(0, _omit.default)(rest, ["bordered"]),
125
+ $bordered: rest?.bordered,
123
126
  $bgcolor: theme?.background?.header,
124
127
  children: !navItems?.length ? null : ({
125
128
  isMobile
@@ -163,6 +166,9 @@ const StyledUxHeader = (0, _Theme.styled)(_Header.ResponsiveHeader)`
163
166
  .header-logo {
164
167
  min-width: 44px;
165
168
  }
169
+ ${({
170
+ $bordered
171
+ }) => $bordered ? `border-bottom: 1px solid ${_Colors.temp.strokeSep};` : ""}
166
172
  ${props => props.theme.breakpoints.down("md")} {
167
173
  .header-logo {
168
174
  min-width: 32px;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import type { StackProps } from '@mui/material';
2
+ import type { BoxProps } from '@mui/material';
3
3
  import type { User } from '../../@types';
4
4
  export default function Passport({ user, ...rest }: {
5
5
  user: User;
6
- } & StackProps): import("react").JSX.Element;
6
+ } & BoxProps): import("react").JSX.Element;
@@ -51,20 +51,27 @@ function Passport({
51
51
  return theme?.palette?.primary?.main || _Colors.temp.textBase;
52
52
  }, [theme?.palette?.primary?.main]);
53
53
  if (passports.length === 0) {
54
- return /* @__PURE__ */(0, _jsxRuntime.jsx)(_Empty.default, {
55
- children: t("noPassport")
54
+ return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
55
+ children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_Empty.default, {
56
+ children: t("noPassport")
57
+ })
56
58
  });
57
59
  }
58
- return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Stack, {
59
- direction: "row",
60
- spacing: 3,
61
- flexWrap: "wrap",
62
- useFlexGap: true,
60
+ return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
63
61
  ...rest,
62
+ sx: {
63
+ display: "grid",
64
+ gridTemplateColumns: {
65
+ xs: "repeat(2, 1fr)",
66
+ sm: "repeat(3, 1fr)",
67
+ md: "repeat(2, 1fr)"
68
+ },
69
+ gap: 2.5,
70
+ ...rest.sx
71
+ },
64
72
  children: passports.map(x => /* @__PURE__ */(0, _jsxRuntime.jsx)(_Passport.default, {
65
73
  passport: x,
66
74
  user,
67
- width: 200,
68
75
  color: window.blocklet.passportColor,
69
76
  createPassportSvg: _utils.createPassportSvg,
70
77
  title: currentRole && currentRole.role === x.role ? t("currentPassport") : "",
@@ -79,8 +86,8 @@ function Passport({
79
86
  px: 2,
80
87
  display: "flex",
81
88
  justifyContent: "center",
82
- backgroundColor: "white",
83
- boxShadow: currentRole && currentRole.role === x.role ? `0px 2px 4px 0px ${activeColor}, 0px 1px 2px -1px ${activeColor}, 0px 0px 0px 1px ${activeColor} !important` : "0px 2px 4px 0px rgba(2, 7, 19, 0.04), 0px 1px 2px -1px rgba(2, 7, 19, 0.08), 0px 0px 0px 1px rgba(2, 7, 19, 0.08) !important"
89
+ backgroundColor: _Colors.temp.backgroundsBgComponent,
90
+ boxShadow: currentRole && currentRole.role === x.role ? `0px 2px 4px 0px ${activeColor}, 0px 1px 2px -1px ${activeColor}, 0px 0px 0px 1px ${activeColor} !important` : "unset"
84
91
  },
85
92
  ".passport-item__body": {
86
93
  marginLeft: "0 !important"
@@ -1,9 +1,10 @@
1
1
  /// <reference types="react" />
2
2
  import type { BoxProps } from '@mui/material';
3
3
  import type { User } from '../../@types';
4
- export default function UserBasicInfo({ user, isMyself, switchPassport, switchProfile, openSettings, ...rest }: {
4
+ export default function UserBasicInfo({ user, isMyself, showFullDid, switchPassport, switchProfile, openSettings, ...rest }: {
5
5
  user: User;
6
- isMyself: boolean;
6
+ isMyself?: boolean;
7
+ showFullDid?: boolean;
7
8
  switchPassport: () => void;
8
9
  switchProfile: () => void;
9
10
  openSettings: () => void;
@@ -22,6 +22,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
22
22
  function UserBasicInfo({
23
23
  user,
24
24
  isMyself = true,
25
+ showFullDid = true,
25
26
  switchPassport,
26
27
  switchProfile,
27
28
  openSettings,
@@ -53,6 +54,7 @@ function UserBasicInfo({
53
54
  backgroundColor: "#fff",
54
55
  position: "relative",
55
56
  overflow: "hidden",
57
+ mb: 1.5,
56
58
  ...(isMyself ? {
57
59
  cursor: "pointer",
58
60
  "&:hover": {
@@ -77,7 +79,7 @@ function UserBasicInfo({
77
79
  },
78
80
  onClick: isMyself ? switchProfile : _noop.default
79
81
  }), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Typography, {
80
- variant: "h5",
82
+ variant: "h6",
81
83
  sx: {
82
84
  fontWeight: "bold",
83
85
  display: "flex",
@@ -95,7 +97,7 @@ function UserBasicInfo({
95
97
  fontSize: "12px",
96
98
  color: _Colors.temp.textBase,
97
99
  borderColor: _Colors.temp.strokeBorderStrong,
98
- backgroundColor: "white",
100
+ backgroundColor: "transparent",
99
101
  textTransform: "capitalize",
100
102
  pr: 1,
101
103
  pl: 0.5,
@@ -116,7 +118,9 @@ function UserBasicInfo({
116
118
  }) : null]
117
119
  }), /* @__PURE__ */(0, _jsxRuntime.jsx)(_DID.default, {
118
120
  did: user.did,
119
- copyable: false
121
+ copyable: false,
122
+ compact: !showFullDid,
123
+ responsive: !showFullDid
120
124
  }), isMyself ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.IconButton, {
121
125
  sx: {
122
126
  borderRadius: 2,
@@ -124,14 +128,7 @@ function UserBasicInfo({
124
128
  backgroundColor: "white",
125
129
  border: `1px solid ${_Colors.temp.strokeBorderBase}`,
126
130
  position: "absolute",
127
- bottom: {
128
- xs: "unset",
129
- md: 0
130
- },
131
- top: {
132
- xs: 0,
133
- md: "unset"
134
- },
131
+ top: 0,
135
132
  right: 0
136
133
  },
137
134
  disableFocusRipple: true,
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
- import type { PaperProps } from '@mui/material';
2
+ import type { BoxProps } from '@mui/material';
3
3
  export default function UserCenter({ children, currentTab, contentProps, disableAutoRedirect, autoPopupSetting, hideFooter, headerProps, footerProps, userDid, }: {
4
4
  readonly children: any;
5
5
  readonly currentTab: string;
6
- readonly contentProps?: PaperProps;
6
+ readonly contentProps?: BoxProps;
7
7
  readonly disableAutoRedirect?: boolean;
8
8
  readonly autoPopupSetting?: boolean;
9
9
  readonly hideFooter?: boolean;
@@ -155,9 +155,6 @@ function UserCenter({
155
155
  settings: {
156
156
  userCenterTabs
157
157
  },
158
- sx: {
159
- mt: -2
160
- },
161
158
  onSave: async () => {
162
159
  await privacyState.runAsync();
163
160
  return privacyState.data;
@@ -186,116 +183,144 @@ function UserCenter({
186
183
  error: formatError
187
184
  });
188
185
  }
189
- return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
190
- sx: {
191
- maxWidth: 880,
192
- margin: "0 auto",
193
- p: 3,
194
- display: "flex",
195
- gap: 2.5,
196
- flexDirection: "column"
197
- },
198
- children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_userBasicInfo.default, {
199
- isMyself,
200
- switchPassport: session.switchPassport,
201
- switchProfile: session.switchProfile,
202
- openSettings,
203
- user: userState.data
204
- }), userCenterTabs.length > 0 && currentTab ? /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
186
+ return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
187
+ children: [/* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
205
188
  sx: {
206
- gridArea: "tabs",
207
- overflow: "auto",
208
- padding: "1px"
189
+ flex: 1
209
190
  },
210
- children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_Tabs.default, {
211
- variant: "card",
212
- tabs: userCenterTabs,
213
- current: currentTab,
214
- onChange: handleChangeTab
215
- }), !privacyState.data || privacyState.loading ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
191
+ children: [userState?.data?.fullName ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
192
+ variant: "h4",
193
+ sx: {
194
+ py: 1.5,
195
+ fontWeight: 700,
196
+ display: {
197
+ xs: "none",
198
+ md: "block"
199
+ }
200
+ },
201
+ children: userState.data.fullName
202
+ }) : null, /* @__PURE__ */(0, _jsxRuntime.jsx)(_userBasicInfo.default, {
203
+ isMyself,
204
+ switchPassport: session.switchPassport,
205
+ switchProfile: session.switchProfile,
206
+ openSettings,
207
+ user: userState.data,
208
+ showFullDid: false,
209
+ sx: {
210
+ display: {
211
+ md: "none",
212
+ xs: "block"
213
+ },
214
+ mb: 1.5
215
+ }
216
+ }), userCenterTabs.length > 0 && currentTab ? /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
216
217
  sx: {
217
- height: "100%",
218
- minWidth: "160px",
219
- minHeight: "160px",
220
- display: "flex",
221
- justifyContent: "center",
222
- alignItems: "center"
218
+ overflow: "auto",
219
+ padding: "1px"
223
220
  },
224
- children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.CircularProgress, {
221
+ children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_Tabs.default, {
222
+ variant: "line",
223
+ tabs: userCenterTabs,
224
+ current: currentTab,
225
+ onChange: handleChangeTab,
225
226
  sx: {
226
- color: _Colors.temp.primary100
227
+ mb: 1.5
227
228
  }
228
- })
229
- }) : /* @__PURE__ */(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
230
- children: currentActiveTab?.protected && !isMyself ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Paper, {
231
- variant: "outlined",
229
+ }), !privacyState.data || privacyState.loading ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
232
230
  sx: {
233
- mt: 2,
234
- borderRadius: 2,
235
- p: 2
231
+ height: "100%",
232
+ minWidth: "160px",
233
+ minHeight: "160px",
234
+ display: "flex",
235
+ justifyContent: "center",
236
+ alignItems: "center"
236
237
  },
237
- children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_Empty.default, {
238
- children: t("underProtected")
238
+ children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.CircularProgress, {
239
+ sx: {
240
+ color: _Colors.temp.primary100
241
+ }
239
242
  })
240
243
  }) : /* @__PURE__ */(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
241
- children: children && /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Paper, {
242
- ...contentProps,
243
- variant: "outlined",
244
- sx: {
245
- mt: 2,
246
- borderRadius: 2,
247
- p: 2,
248
- ...contentProps?.sx
249
- },
250
- children
244
+ children: currentActiveTab?.protected && !isMyself ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
245
+ children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_Empty.default, {
246
+ children: t("underProtected")
247
+ })
248
+ }) : /* @__PURE__ */(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
249
+ children: children && /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
250
+ ...contentProps,
251
+ children
252
+ })
251
253
  })
252
- })
253
- })]
254
- }) : null, !isMyself && userCenterTabs.length === 0 ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
255
- sx: {
256
- gridArea: "tabs",
257
- overflow: "auto",
258
- padding: "1px"
259
- },
260
- children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Paper, {
261
- variant: "outlined",
254
+ })]
255
+ }) : null, userCenterTabs.length === 0 ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
262
256
  sx: {
263
- borderRadius: 2,
264
- p: 2
257
+ display: {
258
+ xs: isMyself ? "none" : "block",
259
+ md: "block"
260
+ },
261
+ py: 3
265
262
  },
266
263
  children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_Empty.default, {
267
264
  children: t("emptyContent")
268
265
  })
269
- })
270
- }) : null, isMyself ? /* @__PURE__ */(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
271
- children: [/* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
272
- children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
273
- variant: "h6",
274
- sx: {
275
- fontWeight: 600,
276
- mb: 1.5
277
- },
278
- children: t("passport")
279
- }), /* @__PURE__ */(0, _jsxRuntime.jsx)(_passport.default, {
280
- user: userState.data
281
- })]
282
- }), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
283
- children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
284
- variant: "h6",
285
- sx: {
286
- fontWeight: 600,
287
- mb: 1.5
288
- },
289
- children: t("userInfo")
290
- }), /* @__PURE__ */(0, _jsxRuntime.jsx)(_userInfo.default, {
291
- user: userState.data,
292
- sx: {
293
- padding: 3,
294
- borderRadius: 3
266
+ }) : null]
267
+ }), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
268
+ sx: {
269
+ display: {
270
+ xs: "none",
271
+ md: "block"
272
+ },
273
+ width: "1px",
274
+ my: -3,
275
+ backgroundColor: _Colors.temp.strokeSep
276
+ }
277
+ }), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
278
+ sx: {
279
+ width: {
280
+ sx: "100%",
281
+ md: 400
282
+ },
283
+ maxWidth: "100%",
284
+ display: "flex",
285
+ flexDirection: "column",
286
+ gap: 2.5
287
+ },
288
+ children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_userBasicInfo.default, {
289
+ isMyself,
290
+ switchPassport: session.switchPassport,
291
+ switchProfile: session.switchProfile,
292
+ openSettings,
293
+ user: userState.data,
294
+ sx: {
295
+ display: {
296
+ xs: "none",
297
+ md: "block"
295
298
  }
299
+ }
300
+ }), isMyself ? /* @__PURE__ */(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
301
+ children: [/* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
302
+ children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
303
+ sx: {
304
+ fontWeight: 600,
305
+ mb: 1.5
306
+ },
307
+ children: t("myInfo")
308
+ }), /* @__PURE__ */(0, _jsxRuntime.jsx)(_userInfo.default, {
309
+ user: userState.data
310
+ })]
311
+ }), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
312
+ children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
313
+ sx: {
314
+ fontWeight: 600,
315
+ mb: 1.5
316
+ },
317
+ children: t("passport")
318
+ }), /* @__PURE__ */(0, _jsxRuntime.jsx)(_passport.default, {
319
+ user: userState.data
320
+ })]
296
321
  })]
297
- })]
298
- }) : null]
322
+ }) : null]
323
+ })]
299
324
  });
300
325
  }, [userState, userCenterTabs]);
301
326
  if (!disableAutoRedirect && !currentTab && formattedBlocklet?.navigation?.userCenter?.length > 0) {
@@ -310,11 +335,26 @@ function UserCenter({
310
335
  flexDirection: "column"
311
336
  },
312
337
  children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_.Header, {
338
+ bordered: true,
313
339
  ...headerProps
314
340
  }), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
315
341
  flex: 1,
342
+ sx: {
343
+ width: "100%",
344
+ maxWidth: 1200,
345
+ margin: "0 auto",
346
+ p: 3,
347
+ display: "flex",
348
+ alignItems: "stretch",
349
+ flexDirection: {
350
+ xs: "column",
351
+ md: "row"
352
+ },
353
+ gap: 2.5
354
+ },
316
355
  children: [content, confirmHolder]
317
356
  }), hideFooter ? null : /* @__PURE__ */(0, _jsxRuntime.jsx)(_.Footer, {
357
+ bordered: true,
318
358
  ...footerProps
319
359
  })]
320
360
  });
@@ -14,33 +14,25 @@ function UserInfoItem({
14
14
  return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
15
15
  ...rest,
16
16
  sx: {
17
- display: "grid",
18
- gridTemplateColumns: "auto 1fr",
19
- gridTemplateAreas: `"icon title" ". content"`,
17
+ display: "flex",
20
18
  alignItems: "center",
21
- rowGap: 0.75,
22
- columnGap: 1,
19
+ justifyContent: "space-between",
23
20
  ...rest.sx
24
21
  },
25
- children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
22
+ children: [/* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Typography, {
26
23
  sx: {
27
- gridArea: "icon",
28
24
  display: "flex",
29
- alignItems: "center"
30
- },
31
- children: data.icon
32
- }), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
33
- sx: {
25
+ alignItems: "center",
34
26
  color: _Colors.temp.textBase,
35
- gridArea: "title",
36
- fontSize: "14px"
27
+ fontSize: "14px",
28
+ gap: 1,
29
+ fontWeight: 500
37
30
  },
38
- children: data.title
31
+ children: [data.icon, data.title]
39
32
  }), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
40
33
  sx: {
41
34
  color: _Colors.temp.textSubtitle,
42
35
  whiteSpace: "pre-wrap",
43
- gridArea: "content",
44
36
  fontSize: "14px"
45
37
  },
46
38
  children: data.content
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import type { PaperProps } from '@mui/material';
2
+ import type { BoxProps } from '@mui/material';
3
3
  import type { User } from '../../@types';
4
4
  export default function UserInfo({ user, ...rest }: {
5
5
  user: User;
6
- } & PaperProps): import("react").JSX.Element;
6
+ } & BoxProps): import("react").JSX.Element;
@@ -12,6 +12,7 @@ var _mailOutlineRounded = _interopRequireDefault(require("@iconify-icons/materia
12
12
  var _scheduleOutlineRounded = _interopRequireDefault(require("@iconify-icons/material-symbols/schedule-outline-rounded"));
13
13
  var _moreTimeRounded = _interopRequireDefault(require("@iconify-icons/material-symbols/more-time-rounded"));
14
14
  var _captivePortalRounded = _interopRequireDefault(require("@iconify-icons/material-symbols/captive-portal-rounded"));
15
+ var _settingsInputAntennaRounded = _interopRequireDefault(require("@iconify-icons/material-symbols/settings-input-antenna-rounded"));
15
16
  var _RelativeTime = _interopRequireDefault(require("@arcblock/ux/lib/RelativeTime"));
16
17
  var _util = require("@arcblock/ux/lib/Locale/util");
17
18
  var _context = require("@arcblock/ux/lib/Locale/context");
@@ -49,15 +50,20 @@ function UserInfo({
49
50
  fontSize: 16,
50
51
  icon: _scheduleOutlineRounded.default
51
52
  }),
52
- title: t("lastLogin"),
53
- content: /* @__PURE__ */(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
54
- children: user?.lastLoginAt || user?.lastLoginIp ? /* @__PURE__ */(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
55
- children: [user?.lastLoginAt ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_RelativeTime.default, {
56
- locale,
57
- value: user?.lastLoginAt
58
- }) : null, user?.lastLoginAt && user?.lastLoginIp ? /* @__PURE__ */(0, _jsxRuntime.jsx)("br", {}) : null, user?.lastLoginIp]
59
- }) : t("unknown")
60
- })
53
+ title: t("lastLoginAt"),
54
+ content: user?.lastLoginAt ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_RelativeTime.default, {
55
+ locale,
56
+ value: user?.lastLoginAt,
57
+ relativeRange: 3 * 86400 * 1e3
58
+ }) : t("unknown")
59
+ });
60
+ userInfoListData.push({
61
+ icon: /* @__PURE__ */(0, _jsxRuntime.jsx)(_react.Icon, {
62
+ fontSize: 16,
63
+ icon: _settingsInputAntennaRounded.default
64
+ }),
65
+ title: t("lastLoginIp"),
66
+ content: user?.lastLoginIp || t("unknown")
61
67
  });
62
68
  userInfoListData.push({
63
69
  icon: /* @__PURE__ */(0, _jsxRuntime.jsx)(_react.Icon, {
@@ -78,17 +84,12 @@ function UserInfo({
78
84
  title: t("registerFrom"),
79
85
  content: readableProvider
80
86
  });
81
- return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Paper, {
82
- variant: "outlined",
87
+ return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
83
88
  ...rest,
84
89
  sx: {
85
90
  display: "flex",
86
- flexDirection: {
87
- xs: "column",
88
- md: "row"
89
- },
90
- alignItems: "flex-start",
91
- gap: 3,
91
+ flexDirection: "column",
92
+ gap: 1.5,
92
93
  ...rest?.sx
93
94
  },
94
95
  children: userInfoListData.map(item => /* @__PURE__ */(0, _jsxRuntime.jsx)(_userInfoItem.default, {