@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.
- package/es/Footer/index.js +12 -2
- package/es/Header/index.js +5 -1
- package/es/UserCenter/components/passport.d.ts +2 -2
- package/es/UserCenter/components/passport.js +44 -29
- package/es/UserCenter/components/user-basic-info.d.ts +3 -2
- package/es/UserCenter/components/user-basic-info.js +6 -11
- package/es/UserCenter/components/user-center.d.ts +2 -2
- package/es/UserCenter/components/user-center.js +160 -100
- package/es/UserCenter/components/user-info-item.js +12 -21
- package/es/UserCenter/components/user-info.d.ts +2 -2
- package/es/UserCenter/components/user-info.js +13 -16
- package/es/UserCenter/libs/locales.d.ts +6 -0
- package/es/UserCenter/libs/locales.js +8 -2
- package/lib/Footer/index.js +7 -2
- package/lib/Header/index.js +7 -1
- package/lib/UserCenter/components/passport.d.ts +2 -2
- package/lib/UserCenter/components/passport.js +17 -10
- package/lib/UserCenter/components/user-basic-info.d.ts +3 -2
- package/lib/UserCenter/components/user-basic-info.js +8 -11
- package/lib/UserCenter/components/user-center.d.ts +2 -2
- package/lib/UserCenter/components/user-center.js +135 -95
- package/lib/UserCenter/components/user-info-item.js +8 -16
- package/lib/UserCenter/components/user-info.d.ts +2 -2
- package/lib/UserCenter/components/user-info.js +18 -17
- package/lib/UserCenter/libs/locales.d.ts +6 -0
- package/lib/UserCenter/libs/locales.js +8 -2
- package/package.json +6 -6
- package/src/Footer/index.jsx +9 -3
- package/src/Header/index.jsx +6 -2
- package/src/UserCenter/components/passport.tsx +23 -9
- package/src/UserCenter/components/user-basic-info.tsx +8 -12
- package/src/UserCenter/components/user-center.tsx +147 -101
- package/src/UserCenter/components/user-info-item.tsx +6 -14
- package/src/UserCenter/components/user-info.tsx +18 -25
- 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
|
};
|
|
@@ -12,6 +12,8 @@ const translations = exports.translations = {
|
|
|
12
12
|
notification: "\u901A\u77E5",
|
|
13
13
|
email: "\u90AE\u7BB1\u5730\u5740",
|
|
14
14
|
lastLogin: "\u4E0A\u6B21\u767B\u5F55",
|
|
15
|
+
lastLoginAt: "\u4E0A\u6B21\u767B\u5F55\u65F6\u95F4",
|
|
16
|
+
lastLoginIp: "\u4E0A\u6B21\u767B\u5F55\u5730\u5740",
|
|
15
17
|
createdAt: "\u521B\u5EFA\u65F6\u95F4",
|
|
16
18
|
registerFrom: "\u6CE8\u518C\u6765\u6E90",
|
|
17
19
|
unknown: "\u672A\u77E5",
|
|
@@ -41,7 +43,8 @@ const translations = exports.translations = {
|
|
|
41
43
|
toPublic: "\u516C\u5F00 \u201C{name}\u201D \u9875\u9762",
|
|
42
44
|
currentPassport: "\u5F53\u524D\u4F7F\u7528\u7684\u901A\u884C\u8BC1",
|
|
43
45
|
switchProfile: "\u5207\u6362",
|
|
44
|
-
userInfo: "\u4E2A\u4EBA\u4FE1\u606F"
|
|
46
|
+
userInfo: "\u4E2A\u4EBA\u4FE1\u606F",
|
|
47
|
+
myInfo: "\u6211\u7684\u4FE1\u606F"
|
|
45
48
|
},
|
|
46
49
|
en: {
|
|
47
50
|
settings: "Settings",
|
|
@@ -50,6 +53,8 @@ const translations = exports.translations = {
|
|
|
50
53
|
notification: "Notification",
|
|
51
54
|
email: "Email",
|
|
52
55
|
lastLogin: "Last Login & IP",
|
|
56
|
+
lastLoginAt: "Last Login",
|
|
57
|
+
lastLoginIp: "Last IP",
|
|
53
58
|
createdAt: "Created At",
|
|
54
59
|
registerFrom: "Register From",
|
|
55
60
|
unknown: "Unknown",
|
|
@@ -79,6 +84,7 @@ const translations = exports.translations = {
|
|
|
79
84
|
toPublic: 'Public "{name}" page',
|
|
80
85
|
currentPassport: "Passport currently in use",
|
|
81
86
|
switchProfile: "Switch",
|
|
82
|
-
userInfo: "User Info"
|
|
87
|
+
userInfo: "User Info",
|
|
88
|
+
myInfo: "My Info"
|
|
83
89
|
}
|
|
84
90
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/ui-react",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.25",
|
|
4
4
|
"description": "Some useful front-end web components that can be used in Blocklets.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -62,10 +62,10 @@
|
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@abtnode/constant": "1.16.23-beta-
|
|
66
|
-
"@arcblock/did-connect": "^2.9.
|
|
67
|
-
"@arcblock/ux": "^2.9.
|
|
68
|
-
"@blocklet/js-sdk": "1.16.23-beta-
|
|
65
|
+
"@abtnode/constant": "1.16.23-beta-c9c4e08e",
|
|
66
|
+
"@arcblock/did-connect": "^2.9.25",
|
|
67
|
+
"@arcblock/ux": "^2.9.25",
|
|
68
|
+
"@blocklet/js-sdk": "1.16.23-beta-c9c4e08e",
|
|
69
69
|
"@emotion/react": "^11.10.4",
|
|
70
70
|
"@emotion/styled": "^11.10.4",
|
|
71
71
|
"@iconify-icons/material-symbols": "^1.2.58",
|
|
@@ -99,5 +99,5 @@
|
|
|
99
99
|
"jest": "^28.1.3",
|
|
100
100
|
"unbuild": "^2.0.0"
|
|
101
101
|
},
|
|
102
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "a55d6db8fb2b95082cbd879ed5469543a2c0835f"
|
|
103
103
|
}
|
package/src/Footer/index.jsx
CHANGED
|
@@ -4,12 +4,13 @@ import { styled } from '@arcblock/ux/lib/Theme';
|
|
|
4
4
|
import { withErrorBoundary } from 'react-error-boundary';
|
|
5
5
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
6
6
|
import { ErrorFallback } from '@arcblock/ux/lib/ErrorBoundary';
|
|
7
|
+
import { temp as colors } from '@arcblock/ux/lib/Colors';
|
|
8
|
+
import omit from 'lodash/omit';
|
|
7
9
|
|
|
8
10
|
import OverridableThemeProvider from '../common/overridable-theme-provider';
|
|
9
11
|
import InternalFooter from './internal-footer';
|
|
10
12
|
import { mapRecursive } from '../utils';
|
|
11
13
|
import { formatBlockletInfo, getLocalizedNavigation } from '../blocklets';
|
|
12
|
-
|
|
13
14
|
import { blockletMetaProps } from '../types';
|
|
14
15
|
|
|
15
16
|
/**
|
|
@@ -60,7 +61,12 @@ function Footer({ meta, theme: themeOverrides, ...rest }) {
|
|
|
60
61
|
|
|
61
62
|
return (
|
|
62
63
|
<OverridableThemeProvider theme={themeOverrides}>
|
|
63
|
-
<StyledInternalFooter
|
|
64
|
+
<StyledInternalFooter
|
|
65
|
+
{...props}
|
|
66
|
+
{...omit(rest, ['bordered'])}
|
|
67
|
+
$bordered={rest?.bordered}
|
|
68
|
+
$bgcolor={theme?.background?.footer}
|
|
69
|
+
/>
|
|
64
70
|
</OverridableThemeProvider>
|
|
65
71
|
);
|
|
66
72
|
}
|
|
@@ -77,7 +83,7 @@ Footer.defaultProps = {
|
|
|
77
83
|
};
|
|
78
84
|
|
|
79
85
|
const StyledInternalFooter = styled(InternalFooter)`
|
|
80
|
-
border-top: 1px solid #eee
|
|
86
|
+
${({ $bordered }) => `border-top: 1px solid ${$bordered ? colors.strokeSep : '#eee'};`}
|
|
81
87
|
color: ${(props) => props.theme.palette.grey[600]};
|
|
82
88
|
${({ $bgcolor }) => $bgcolor && `background-color: ${$bgcolor};`}
|
|
83
89
|
font-family: Inter, Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif,
|
package/src/Header/index.jsx
CHANGED
|
@@ -6,9 +6,11 @@ import { styled } from '@arcblock/ux/lib/Theme';
|
|
|
6
6
|
import { ResponsiveHeader } from '@arcblock/ux/lib/Header';
|
|
7
7
|
import NavMenu from '@arcblock/ux/lib/NavMenu';
|
|
8
8
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
9
|
+
import { temp as colors } from '@arcblock/ux/lib/Colors';
|
|
10
|
+
import omit from 'lodash/omit';
|
|
11
|
+
|
|
9
12
|
import Icon from '../Icon';
|
|
10
13
|
import OverridableThemeProvider from '../common/overridable-theme-provider';
|
|
11
|
-
|
|
12
14
|
import { blockletMetaProps, sessionManagerProps } from '../types';
|
|
13
15
|
import { mapRecursive, flatRecursive, matchPaths } from '../utils';
|
|
14
16
|
import { publicPath, formatBlockletInfo, getLocalizedNavigation } from '../blocklets';
|
|
@@ -92,7 +94,8 @@ function Header({ meta, addons, sessionManagerProps, homeLink, theme: themeOverr
|
|
|
92
94
|
homeLink={homeLink}
|
|
93
95
|
logo={<img src={appLogoRect || appLogo} alt="logo" />}
|
|
94
96
|
addons={headerAddons}
|
|
95
|
-
{...rest}
|
|
97
|
+
{...omit(rest, ['bordered'])}
|
|
98
|
+
$bordered={rest?.bordered}
|
|
96
99
|
$bgcolor={theme?.background?.header}>
|
|
97
100
|
{/* blocklet.yml 没有配置 navigation 时, 则为 children 传入 null, 此时 ResponsiveHeader 会渲染普通的不带 menu 的 Header */}
|
|
98
101
|
{!navItems?.length
|
|
@@ -143,6 +146,7 @@ const StyledUxHeader = styled(ResponsiveHeader)`
|
|
|
143
146
|
.header-logo {
|
|
144
147
|
min-width: 44px;
|
|
145
148
|
}
|
|
149
|
+
${({ $bordered }) => ($bordered ? `border-bottom: 1px solid ${colors.strokeSep};` : '')}
|
|
146
150
|
${(props) => props.theme.breakpoints.down('md')} {
|
|
147
151
|
.header-logo {
|
|
148
152
|
min-width: 32px;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
1
|
+
import { Box } from '@mui/material';
|
|
2
|
+
import type { BoxProps } from '@mui/material';
|
|
3
3
|
import Empty from '@arcblock/ux/lib/Empty';
|
|
4
4
|
import { useTheme } from '@arcblock/ux/lib/Theme';
|
|
5
5
|
import { temp as colors } from '@arcblock/ux/lib/Colors';
|
|
@@ -14,7 +14,7 @@ import { translations } from '../libs/locales';
|
|
|
14
14
|
import { createPassportSvg } from '../libs/utils';
|
|
15
15
|
import type { User } from '../../@types';
|
|
16
16
|
|
|
17
|
-
export default function Passport({ user, ...rest }: { user: User } &
|
|
17
|
+
export default function Passport({ user, ...rest }: { user: User } & BoxProps) {
|
|
18
18
|
const { locale } = useLocaleContext();
|
|
19
19
|
const t = useMemoizedFn((key, data = {}) => {
|
|
20
20
|
return translate(translations, key, locale, 'en', data);
|
|
@@ -46,17 +46,31 @@ export default function Passport({ user, ...rest }: { user: User } & StackProps)
|
|
|
46
46
|
}, [theme?.palette?.primary?.main]);
|
|
47
47
|
|
|
48
48
|
if (passports.length === 0) {
|
|
49
|
-
return
|
|
49
|
+
return (
|
|
50
|
+
<Box>
|
|
51
|
+
<Empty>{t('noPassport')}</Empty>
|
|
52
|
+
</Box>
|
|
53
|
+
);
|
|
50
54
|
}
|
|
51
55
|
|
|
52
56
|
return (
|
|
53
|
-
<
|
|
57
|
+
<Box
|
|
58
|
+
{...rest}
|
|
59
|
+
sx={{
|
|
60
|
+
display: 'grid',
|
|
61
|
+
gridTemplateColumns: {
|
|
62
|
+
xs: 'repeat(2, 1fr)',
|
|
63
|
+
sm: 'repeat(3, 1fr)',
|
|
64
|
+
md: 'repeat(2, 1fr)',
|
|
65
|
+
},
|
|
66
|
+
gap: 2.5,
|
|
67
|
+
...rest.sx,
|
|
68
|
+
}}>
|
|
54
69
|
{passports.map((x) => (
|
|
55
70
|
<PassportItem
|
|
56
71
|
key={x.id}
|
|
57
72
|
passport={x}
|
|
58
73
|
user={user}
|
|
59
|
-
width={200}
|
|
60
74
|
color={window.blocklet.passportColor}
|
|
61
75
|
createPassportSvg={createPassportSvg}
|
|
62
76
|
title={currentRole && currentRole.role === x.role ? t('currentPassport') : ''}
|
|
@@ -71,11 +85,11 @@ export default function Passport({ user, ...rest }: { user: User } & StackProps)
|
|
|
71
85
|
px: 2,
|
|
72
86
|
display: 'flex',
|
|
73
87
|
justifyContent: 'center',
|
|
74
|
-
backgroundColor:
|
|
88
|
+
backgroundColor: colors.backgroundsBgComponent,
|
|
75
89
|
boxShadow:
|
|
76
90
|
currentRole && currentRole.role === x.role
|
|
77
91
|
? `0px 2px 4px 0px ${activeColor}, 0px 1px 2px -1px ${activeColor}, 0px 0px 0px 1px ${activeColor} !important`
|
|
78
|
-
: '
|
|
92
|
+
: 'unset',
|
|
79
93
|
},
|
|
80
94
|
'.passport-item__body': {
|
|
81
95
|
marginLeft: '0 !important',
|
|
@@ -83,6 +97,6 @@ export default function Passport({ user, ...rest }: { user: User } & StackProps)
|
|
|
83
97
|
}}
|
|
84
98
|
/>
|
|
85
99
|
))}
|
|
86
|
-
</
|
|
100
|
+
</Box>
|
|
87
101
|
);
|
|
88
102
|
}
|
|
@@ -18,13 +18,15 @@ import type { User } from '../../@types';
|
|
|
18
18
|
export default function UserBasicInfo({
|
|
19
19
|
user,
|
|
20
20
|
isMyself = true,
|
|
21
|
+
showFullDid = true,
|
|
21
22
|
switchPassport,
|
|
22
23
|
switchProfile,
|
|
23
24
|
openSettings,
|
|
24
25
|
...rest
|
|
25
26
|
}: {
|
|
26
27
|
user: User;
|
|
27
|
-
isMyself
|
|
28
|
+
isMyself?: boolean;
|
|
29
|
+
showFullDid?: boolean;
|
|
28
30
|
switchPassport: () => void;
|
|
29
31
|
switchProfile: () => void;
|
|
30
32
|
openSettings: () => void;
|
|
@@ -59,6 +61,7 @@ export default function UserBasicInfo({
|
|
|
59
61
|
backgroundColor: '#fff',
|
|
60
62
|
position: 'relative',
|
|
61
63
|
overflow: 'hidden',
|
|
64
|
+
mb: 1.5,
|
|
62
65
|
...(isMyself
|
|
63
66
|
? {
|
|
64
67
|
cursor: 'pointer',
|
|
@@ -86,7 +89,7 @@ export default function UserBasicInfo({
|
|
|
86
89
|
onClick={isMyself ? switchProfile : noop}
|
|
87
90
|
/>
|
|
88
91
|
<Typography
|
|
89
|
-
variant="
|
|
92
|
+
variant="h6"
|
|
90
93
|
sx={{
|
|
91
94
|
fontWeight: 'bold',
|
|
92
95
|
display: 'flex',
|
|
@@ -106,7 +109,7 @@ export default function UserBasicInfo({
|
|
|
106
109
|
fontSize: '12px',
|
|
107
110
|
color: colors.textBase,
|
|
108
111
|
borderColor: colors.strokeBorderStrong,
|
|
109
|
-
backgroundColor: '
|
|
112
|
+
backgroundColor: 'transparent',
|
|
110
113
|
textTransform: 'capitalize',
|
|
111
114
|
pr: 1,
|
|
112
115
|
pl: 0.5,
|
|
@@ -124,7 +127,7 @@ export default function UserBasicInfo({
|
|
|
124
127
|
/>
|
|
125
128
|
) : null}
|
|
126
129
|
</Typography>
|
|
127
|
-
<DID did={user.did} copyable={false} />
|
|
130
|
+
<DID did={user.did} copyable={false} compact={!showFullDid} responsive={!showFullDid} />
|
|
128
131
|
{isMyself ? (
|
|
129
132
|
<IconButton
|
|
130
133
|
sx={{
|
|
@@ -133,14 +136,7 @@ export default function UserBasicInfo({
|
|
|
133
136
|
backgroundColor: 'white',
|
|
134
137
|
border: `1px solid ${colors.strokeBorderBase}`,
|
|
135
138
|
position: 'absolute',
|
|
136
|
-
|
|
137
|
-
xs: 'unset',
|
|
138
|
-
md: 0,
|
|
139
|
-
},
|
|
140
|
-
top: {
|
|
141
|
-
xs: 0,
|
|
142
|
-
md: 'unset',
|
|
143
|
-
},
|
|
139
|
+
top: 0,
|
|
144
140
|
right: 0,
|
|
145
141
|
}}
|
|
146
142
|
disableFocusRipple
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
|
-
import { Box, CircularProgress,
|
|
3
|
-
import type {
|
|
2
|
+
import { Box, CircularProgress, Typography } from '@mui/material';
|
|
3
|
+
import type { BoxProps } from '@mui/material';
|
|
4
4
|
import { useCreation, useMemoizedFn, useMount, useRequest } from 'ahooks';
|
|
5
5
|
|
|
6
6
|
import { SessionContext } from '@arcblock/did-connect/lib/Session';
|
|
7
|
-
|
|
8
7
|
import Tabs from '@arcblock/ux/lib/Tabs';
|
|
9
8
|
import Empty from '@arcblock/ux/lib/Empty';
|
|
10
9
|
import { temp as colors } from '@arcblock/ux/lib/Colors';
|
|
@@ -40,7 +39,7 @@ export default function UserCenter({
|
|
|
40
39
|
}: {
|
|
41
40
|
readonly children: any;
|
|
42
41
|
readonly currentTab: string;
|
|
43
|
-
readonly contentProps?:
|
|
42
|
+
readonly contentProps?: BoxProps;
|
|
44
43
|
readonly disableAutoRedirect?: boolean;
|
|
45
44
|
readonly autoPopupSetting?: boolean;
|
|
46
45
|
readonly hideFooter?: boolean;
|
|
@@ -176,7 +175,6 @@ export default function UserCenter({
|
|
|
176
175
|
settings={{
|
|
177
176
|
userCenterTabs,
|
|
178
177
|
}}
|
|
179
|
-
sx={{ mt: -2 }}
|
|
180
178
|
onSave={async () => {
|
|
181
179
|
await privacyState.runAsync();
|
|
182
180
|
return privacyState.data;
|
|
@@ -212,104 +210,138 @@ export default function UserCenter({
|
|
|
212
210
|
}
|
|
213
211
|
|
|
214
212
|
return (
|
|
215
|
-
|
|
216
|
-
sx={{
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}
|
|
238
|
-
<Tabs variant="card" tabs={userCenterTabs} current={currentTab} onChange={handleChangeTab} />
|
|
239
|
-
{!privacyState.data || privacyState.loading ? (
|
|
240
|
-
<Box
|
|
241
|
-
sx={{
|
|
242
|
-
height: '100%',
|
|
243
|
-
minWidth: '160px',
|
|
244
|
-
minHeight: '160px',
|
|
245
|
-
display: 'flex',
|
|
246
|
-
justifyContent: 'center',
|
|
247
|
-
alignItems: 'center',
|
|
248
|
-
}}>
|
|
249
|
-
<CircularProgress sx={{ color: colors.primary100 }} />
|
|
250
|
-
</Box>
|
|
251
|
-
) : (
|
|
252
|
-
<>
|
|
253
|
-
{currentActiveTab?.protected && !isMyself ? (
|
|
254
|
-
<Paper variant="outlined" sx={{ mt: 2, borderRadius: 2, p: 2 }}>
|
|
255
|
-
<Empty>{t('underProtected')}</Empty>
|
|
256
|
-
</Paper>
|
|
257
|
-
) : (
|
|
258
|
-
<>
|
|
259
|
-
{children && (
|
|
260
|
-
<Paper
|
|
261
|
-
{...contentProps}
|
|
262
|
-
variant="outlined"
|
|
263
|
-
sx={{ mt: 2, borderRadius: 2, p: 2, ...contentProps?.sx }}>
|
|
264
|
-
{children}
|
|
265
|
-
</Paper>
|
|
266
|
-
)}
|
|
267
|
-
</>
|
|
268
|
-
)}
|
|
269
|
-
</>
|
|
270
|
-
)}
|
|
271
|
-
</Box>
|
|
272
|
-
) : null}
|
|
273
|
-
{!isMyself && userCenterTabs.length === 0 ? (
|
|
274
|
-
<Box
|
|
213
|
+
<>
|
|
214
|
+
<Box sx={{ flex: 1 }}>
|
|
215
|
+
{userState?.data?.fullName ? (
|
|
216
|
+
<Typography
|
|
217
|
+
variant="h4"
|
|
218
|
+
sx={{
|
|
219
|
+
py: 1.5,
|
|
220
|
+
fontWeight: 700,
|
|
221
|
+
display: {
|
|
222
|
+
xs: 'none',
|
|
223
|
+
md: 'block',
|
|
224
|
+
},
|
|
225
|
+
}}>
|
|
226
|
+
{userState.data.fullName}
|
|
227
|
+
</Typography>
|
|
228
|
+
) : null}
|
|
229
|
+
<UserBasicInfo
|
|
230
|
+
isMyself={isMyself}
|
|
231
|
+
switchPassport={session.switchPassport}
|
|
232
|
+
switchProfile={session.switchProfile}
|
|
233
|
+
openSettings={openSettings}
|
|
234
|
+
user={userState.data}
|
|
235
|
+
showFullDid={false}
|
|
275
236
|
sx={{
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
237
|
+
display: {
|
|
238
|
+
md: 'none',
|
|
239
|
+
xs: 'block',
|
|
240
|
+
},
|
|
241
|
+
mb: 1.5,
|
|
242
|
+
}}
|
|
243
|
+
/>
|
|
244
|
+
{userCenterTabs.length > 0 && currentTab ? (
|
|
245
|
+
<Box
|
|
282
246
|
sx={{
|
|
283
|
-
|
|
284
|
-
|
|
247
|
+
overflow: 'auto',
|
|
248
|
+
padding: '1px',
|
|
285
249
|
}}>
|
|
286
|
-
<
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
<Box>
|
|
293
|
-
<Typography variant="h6" sx={{ fontWeight: 600, mb: 1.5 }}>
|
|
294
|
-
{t('passport')}
|
|
295
|
-
</Typography>
|
|
296
|
-
<Passport user={userState.data} />
|
|
297
|
-
</Box>
|
|
298
|
-
<Box>
|
|
299
|
-
<Typography variant="h6" sx={{ fontWeight: 600, mb: 1.5 }}>
|
|
300
|
-
{t('userInfo')}
|
|
301
|
-
</Typography>
|
|
302
|
-
<UserInfo
|
|
303
|
-
user={userState.data}
|
|
304
|
-
sx={{
|
|
305
|
-
padding: 3,
|
|
306
|
-
borderRadius: 3,
|
|
307
|
-
}}
|
|
250
|
+
<Tabs
|
|
251
|
+
variant="line"
|
|
252
|
+
tabs={userCenterTabs}
|
|
253
|
+
current={currentTab}
|
|
254
|
+
onChange={handleChangeTab}
|
|
255
|
+
sx={{ mb: 1.5 }}
|
|
308
256
|
/>
|
|
257
|
+
{!privacyState.data || privacyState.loading ? (
|
|
258
|
+
<Box
|
|
259
|
+
sx={{
|
|
260
|
+
height: '100%',
|
|
261
|
+
minWidth: '160px',
|
|
262
|
+
minHeight: '160px',
|
|
263
|
+
display: 'flex',
|
|
264
|
+
justifyContent: 'center',
|
|
265
|
+
alignItems: 'center',
|
|
266
|
+
}}>
|
|
267
|
+
<CircularProgress sx={{ color: colors.primary100 }} />
|
|
268
|
+
</Box>
|
|
269
|
+
) : (
|
|
270
|
+
<>
|
|
271
|
+
{currentActiveTab?.protected && !isMyself ? (
|
|
272
|
+
<Box>
|
|
273
|
+
<Empty>{t('underProtected')}</Empty>
|
|
274
|
+
</Box>
|
|
275
|
+
) : (
|
|
276
|
+
<>{children && <Box {...contentProps}>{children}</Box>}</>
|
|
277
|
+
)}
|
|
278
|
+
</>
|
|
279
|
+
)}
|
|
309
280
|
</Box>
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
281
|
+
) : null}
|
|
282
|
+
{userCenterTabs.length === 0 ? (
|
|
283
|
+
<Box
|
|
284
|
+
sx={{
|
|
285
|
+
display: {
|
|
286
|
+
xs: isMyself ? 'none' : 'block',
|
|
287
|
+
md: 'block',
|
|
288
|
+
},
|
|
289
|
+
py: 3,
|
|
290
|
+
}}>
|
|
291
|
+
<Empty>{t('emptyContent')}</Empty>
|
|
292
|
+
</Box>
|
|
293
|
+
) : null}
|
|
294
|
+
</Box>
|
|
295
|
+
<Box
|
|
296
|
+
sx={{
|
|
297
|
+
display: {
|
|
298
|
+
xs: 'none',
|
|
299
|
+
md: 'block',
|
|
300
|
+
},
|
|
301
|
+
width: '1px',
|
|
302
|
+
my: -3,
|
|
303
|
+
backgroundColor: colors.strokeSep,
|
|
304
|
+
}}
|
|
305
|
+
/>
|
|
306
|
+
<Box
|
|
307
|
+
sx={{
|
|
308
|
+
width: {
|
|
309
|
+
sx: '100%',
|
|
310
|
+
md: 400,
|
|
311
|
+
},
|
|
312
|
+
maxWidth: '100%',
|
|
313
|
+
display: 'flex',
|
|
314
|
+
flexDirection: 'column',
|
|
315
|
+
gap: 2.5,
|
|
316
|
+
}}>
|
|
317
|
+
<UserBasicInfo
|
|
318
|
+
isMyself={isMyself}
|
|
319
|
+
switchPassport={session.switchPassport}
|
|
320
|
+
switchProfile={session.switchProfile}
|
|
321
|
+
openSettings={openSettings}
|
|
322
|
+
user={userState.data}
|
|
323
|
+
sx={{
|
|
324
|
+
display: {
|
|
325
|
+
xs: 'none',
|
|
326
|
+
md: 'block',
|
|
327
|
+
},
|
|
328
|
+
}}
|
|
329
|
+
/>
|
|
330
|
+
|
|
331
|
+
{isMyself ? (
|
|
332
|
+
<>
|
|
333
|
+
<Box>
|
|
334
|
+
<Typography sx={{ fontWeight: 600, mb: 1.5 }}>{t('myInfo')}</Typography>
|
|
335
|
+
<UserInfo user={userState.data} />
|
|
336
|
+
</Box>
|
|
337
|
+
<Box>
|
|
338
|
+
<Typography sx={{ fontWeight: 600, mb: 1.5 }}>{t('passport')}</Typography>
|
|
339
|
+
<Passport user={userState.data} />
|
|
340
|
+
</Box>
|
|
341
|
+
</>
|
|
342
|
+
) : null}
|
|
343
|
+
</Box>
|
|
344
|
+
</>
|
|
313
345
|
);
|
|
314
346
|
}, [userState, userCenterTabs]);
|
|
315
347
|
|
|
@@ -326,12 +358,26 @@ export default function UserCenter({
|
|
|
326
358
|
display: 'flex',
|
|
327
359
|
flexDirection: 'column',
|
|
328
360
|
}}>
|
|
329
|
-
<Header {...headerProps} />
|
|
330
|
-
<Box
|
|
361
|
+
<Header bordered {...headerProps} />
|
|
362
|
+
<Box
|
|
363
|
+
flex={1}
|
|
364
|
+
sx={{
|
|
365
|
+
width: '100%',
|
|
366
|
+
maxWidth: 1200,
|
|
367
|
+
margin: '0 auto',
|
|
368
|
+
p: 3,
|
|
369
|
+
display: 'flex',
|
|
370
|
+
alignItems: 'stretch',
|
|
371
|
+
flexDirection: {
|
|
372
|
+
xs: 'column',
|
|
373
|
+
md: 'row',
|
|
374
|
+
},
|
|
375
|
+
gap: 2.5,
|
|
376
|
+
}}>
|
|
331
377
|
{content}
|
|
332
378
|
{confirmHolder}
|
|
333
379
|
</Box>
|
|
334
|
-
{hideFooter ? null : <Footer {...footerProps} />}
|
|
380
|
+
{hideFooter ? null : <Footer bordered {...footerProps} />}
|
|
335
381
|
</Box>
|
|
336
382
|
);
|
|
337
383
|
}
|
|
@@ -14,35 +14,27 @@ export default function UserInfoItem({ data, ...rest }: TUserInfoItemProps & Box
|
|
|
14
14
|
<Box
|
|
15
15
|
{...rest}
|
|
16
16
|
sx={{
|
|
17
|
-
display: '
|
|
18
|
-
gridTemplateColumns: 'auto 1fr',
|
|
19
|
-
gridTemplateAreas: `"icon title" ". content"`,
|
|
17
|
+
display: 'flex',
|
|
20
18
|
alignItems: 'center',
|
|
21
|
-
|
|
22
|
-
columnGap: 1,
|
|
19
|
+
justifyContent: 'space-between',
|
|
23
20
|
...rest.sx,
|
|
24
21
|
}}>
|
|
25
|
-
<
|
|
22
|
+
<Typography
|
|
26
23
|
sx={{
|
|
27
|
-
gridArea: 'icon',
|
|
28
24
|
display: 'flex',
|
|
29
25
|
alignItems: 'center',
|
|
30
|
-
}}>
|
|
31
|
-
{data.icon}
|
|
32
|
-
</Box>
|
|
33
|
-
<Typography
|
|
34
|
-
sx={{
|
|
35
26
|
color: colors.textBase,
|
|
36
|
-
gridArea: 'title',
|
|
37
27
|
fontSize: '14px',
|
|
28
|
+
gap: 1,
|
|
29
|
+
fontWeight: 500,
|
|
38
30
|
}}>
|
|
31
|
+
{data.icon}
|
|
39
32
|
{data.title}
|
|
40
33
|
</Typography>
|
|
41
34
|
<Typography
|
|
42
35
|
sx={{
|
|
43
36
|
color: colors.textSubtitle,
|
|
44
37
|
whiteSpace: 'pre-wrap',
|
|
45
|
-
gridArea: 'content',
|
|
46
38
|
fontSize: '14px',
|
|
47
39
|
}}>
|
|
48
40
|
{data.content}
|