@blocklet/ui-react 2.13.12 → 2.13.14
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/ComponentInstaller/index.js +6 -7
- package/lib/ComponentInstaller/installer-item.js +6 -6
- package/lib/Dashboard/index.js +6 -4
- package/lib/Footer/index.js +9 -5
- package/lib/Footer/links.js +1 -1
- package/lib/Footer/social-media.js +3 -12
- package/lib/Header/index.js +7 -6
- package/lib/Notifications/hooks/use-title.js +7 -5
- package/lib/UserCenter/components/config-profile.js +2 -3
- package/lib/UserCenter/components/editable-field.d.ts +2 -0
- package/lib/UserCenter/components/editable-field.js +4 -5
- package/lib/UserCenter/components/nft.js +3 -4
- package/lib/UserCenter/components/notification.js +4 -7
- package/lib/UserCenter/components/passport.js +3 -6
- package/lib/UserCenter/components/settings.js +4 -4
- package/lib/UserCenter/components/status-dialog/index.js +4 -5
- package/lib/UserCenter/components/status-selector/duration-menu.d.ts +1 -3
- package/lib/UserCenter/components/status-selector/duration-menu.js +2 -4
- package/lib/UserCenter/components/status-selector/menu-item.d.ts +1 -3
- package/lib/UserCenter/components/status-selector/menu-item.js +2 -4
- package/lib/UserCenter/components/third-party-login/index.js +3 -1
- package/lib/UserCenter/components/third-party-login/third-party-item.js +21 -17
- package/lib/UserCenter/components/user-center.js +6 -7
- package/lib/UserCenter/components/user-info/address.js +2 -3
- package/lib/UserCenter/components/user-info/link-preview-input.js +8 -8
- package/lib/UserCenter/components/user-info/metadata.js +1 -1
- package/lib/UserCenter/components/user-info/switch-role.js +5 -8
- package/lib/UserCenter/components/user-info/timezone-select.js +13 -8
- package/lib/UserCenter/components/user-info/user-basic-info.js +3 -4
- package/lib/UserCenter/components/user-info/user-info-item.js +2 -3
- package/lib/UserCenter/components/user-info/utils.d.ts +2 -2
- package/lib/UserCenter/components/user-info/utils.js +12 -13
- package/lib/UserCenter/components/webhook-item.js +16 -13
- package/lib/UserSessions/components/user-session-info.js +2 -3
- package/lib/UserSessions/components/user-sessions.js +9 -6
- package/lib/common/header-addons.js +1 -1
- package/lib/hooks/use-blocklet-logo.d.ts +8 -0
- package/lib/hooks/use-blocklet-logo.js +23 -0
- package/package.json +5 -5
- package/src/ComponentInstaller/index.jsx +7 -7
- package/src/ComponentInstaller/installer-item.jsx +6 -6
- package/src/Dashboard/index.jsx +6 -4
- package/src/Footer/index.jsx +9 -5
- package/src/Footer/links.jsx +1 -1
- package/src/Footer/social-media.jsx +3 -9
- package/src/Header/index.tsx +7 -6
- package/src/Notifications/hooks/use-title.tsx +8 -5
- package/src/UserCenter/components/config-profile.tsx +2 -3
- package/src/UserCenter/components/editable-field.tsx +6 -5
- package/src/UserCenter/components/nft.tsx +3 -4
- package/src/UserCenter/components/notification.tsx +4 -7
- package/src/UserCenter/components/passport.tsx +3 -7
- package/src/UserCenter/components/settings.tsx +4 -4
- package/src/UserCenter/components/status-dialog/index.tsx +4 -5
- package/src/UserCenter/components/status-selector/duration-menu.tsx +2 -4
- package/src/UserCenter/components/status-selector/menu-item.tsx +2 -4
- package/src/UserCenter/components/third-party-login/index.tsx +18 -14
- package/src/UserCenter/components/third-party-login/third-party-item.tsx +22 -17
- package/src/UserCenter/components/user-center.tsx +6 -7
- package/src/UserCenter/components/user-info/address.tsx +3 -3
- package/src/UserCenter/components/user-info/link-preview-input.tsx +9 -10
- package/src/UserCenter/components/user-info/metadata.tsx +1 -1
- package/src/UserCenter/components/user-info/switch-role.tsx +6 -9
- package/src/UserCenter/components/user-info/timezone-select.tsx +12 -9
- package/src/UserCenter/components/user-info/user-basic-info.tsx +3 -4
- package/src/UserCenter/components/user-info/user-info-item.tsx +2 -3
- package/src/UserCenter/components/user-info/utils.ts +13 -13
- package/src/UserCenter/components/webhook-item.tsx +16 -13
- package/src/UserSessions/components/user-session-info.tsx +2 -3
- package/src/UserSessions/components/user-sessions.tsx +9 -5
- package/src/common/header-addons.jsx +2 -2
- package/src/hooks/use-blocklet-logo.tsx +32 -0
|
@@ -6,6 +6,7 @@ import { getConnectedAccounts, getSourceProvider } from '@arcblock/ux/lib/Sessio
|
|
|
6
6
|
import { LOGIN_PROVIDER } from '@arcblock/ux/lib/Util/constant';
|
|
7
7
|
import { SessionContext } from '@arcblock/did-connect/lib/Session';
|
|
8
8
|
import { PasskeyActions } from '@arcblock/did-connect/lib/Passkey';
|
|
9
|
+
import { useBrowser } from '@arcblock/react-hooks';
|
|
9
10
|
|
|
10
11
|
import type { ConnectedAccount, OAuthAccount, User, SessionContext as TSessionContext } from '../../../@types';
|
|
11
12
|
import ThirdPartyItem from './third-party-item';
|
|
@@ -18,6 +19,7 @@ export default function ThirdPartyLogin({ user }: { user: User }) {
|
|
|
18
19
|
const { session } = useContext<TSessionContext>(SessionContext);
|
|
19
20
|
const [oauthConfigs, setOauthConfigs] = useState<Record<string, ConnectedAccountProps>>({});
|
|
20
21
|
const { getOAuthConfigs } = session.useOAuth();
|
|
22
|
+
const browser = useBrowser();
|
|
21
23
|
|
|
22
24
|
useAsyncEffect(async () => {
|
|
23
25
|
const data = await getOAuthConfigs({
|
|
@@ -174,20 +176,22 @@ export default function ThirdPartyLogin({ user }: { user: User }) {
|
|
|
174
176
|
{walletAccounts.map((account) => {
|
|
175
177
|
return <ThirdPartyItem key={account.id} item={account as OAuthAccount} />;
|
|
176
178
|
})}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
179
|
+
{browser.wallet || browser.arcSphere ? null : (
|
|
180
|
+
<PasskeyActions
|
|
181
|
+
behavior="only-new"
|
|
182
|
+
action="connect"
|
|
183
|
+
createMode="connect"
|
|
184
|
+
createButtonText="Add New Passkey"
|
|
185
|
+
onSuccess={noop}
|
|
186
|
+
onError={noop}
|
|
187
|
+
dense
|
|
188
|
+
sx={{
|
|
189
|
+
px: 1.5,
|
|
190
|
+
py: 1,
|
|
191
|
+
gap: 0.75,
|
|
192
|
+
}}
|
|
193
|
+
/>
|
|
194
|
+
)}
|
|
191
195
|
</>
|
|
192
196
|
)}
|
|
193
197
|
</Box>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Icon } from '@iconify/react';
|
|
2
2
|
import { Box, Tooltip, Typography } from '@mui/material';
|
|
3
3
|
import LinkRoundedIcon from '@iconify-icons/material-symbols/link-rounded';
|
|
4
|
-
import { temp as colors } from '@arcblock/ux/lib/Colors';
|
|
5
4
|
import Button from '@arcblock/ux/lib/Button';
|
|
6
5
|
import Avatar from '@arcblock/ux/lib/Avatar';
|
|
7
6
|
import { useCreation, useMemoizedFn, useReactive } from 'ahooks';
|
|
@@ -158,9 +157,10 @@ export default function ThirdPartyItem({
|
|
|
158
157
|
<>
|
|
159
158
|
<Box
|
|
160
159
|
sx={{
|
|
161
|
-
borderRadius:
|
|
162
|
-
border:
|
|
163
|
-
|
|
160
|
+
borderRadius: 1,
|
|
161
|
+
border: '1px solid',
|
|
162
|
+
borderColor: 'divider',
|
|
163
|
+
backgroundColor: 'grey.50',
|
|
164
164
|
display: 'flex',
|
|
165
165
|
alignItems: 'center',
|
|
166
166
|
py: 1,
|
|
@@ -232,7 +232,7 @@ export default function ThirdPartyItem({
|
|
|
232
232
|
<Box
|
|
233
233
|
component={Icon}
|
|
234
234
|
icon={InfoOutlineRoundedIcon}
|
|
235
|
-
color=
|
|
235
|
+
color="text.secondary"
|
|
236
236
|
fontSize={16}
|
|
237
237
|
sx={{ cursor: 'pointer', flexShrink: 0 }}
|
|
238
238
|
/>
|
|
@@ -246,18 +246,23 @@ export default function ThirdPartyItem({
|
|
|
246
246
|
<Button
|
|
247
247
|
variant="outlined"
|
|
248
248
|
size="small"
|
|
249
|
-
sx={{
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
249
|
+
sx={(theme) => {
|
|
250
|
+
const textRed = theme.palette.error.main;
|
|
251
|
+
const textPrimary = theme.palette.primary.main;
|
|
252
|
+
|
|
253
|
+
return {
|
|
254
|
+
color: item?._bind ? textRed : textPrimary,
|
|
255
|
+
borderColor: item?._bind ? textRed : textPrimary,
|
|
256
|
+
backgroundColor: 'background.default',
|
|
257
|
+
'&:hover': {
|
|
258
|
+
borderColor: item?._bind ? textRed : textPrimary,
|
|
259
|
+
backgroundColor: 'action.hover',
|
|
260
|
+
},
|
|
261
|
+
py: 0.5,
|
|
262
|
+
borderRadius: 1,
|
|
263
|
+
fontWeight: 500,
|
|
264
|
+
whiteSpace: 'nowrap',
|
|
265
|
+
};
|
|
261
266
|
}}
|
|
262
267
|
fullWidth
|
|
263
268
|
startIcon={currentState.loading ? null : <Icon icon={LinkRoundedIcon} />}
|
|
@@ -9,7 +9,6 @@ import Tabs from '@arcblock/ux/lib/Tabs';
|
|
|
9
9
|
import Empty from '@arcblock/ux/lib/Empty';
|
|
10
10
|
import Button from '@arcblock/ux/lib/Button';
|
|
11
11
|
import Result from '@arcblock/ux/lib/Result';
|
|
12
|
-
import { temp as colors } from '@arcblock/ux/lib/Colors';
|
|
13
12
|
import { useConfirm } from '@arcblock/ux/lib/Dialog';
|
|
14
13
|
import { translate } from '@arcblock/ux/lib/Locale/util';
|
|
15
14
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
@@ -179,7 +178,7 @@ export default function UserCenter({
|
|
|
179
178
|
fullScreen: isMobile,
|
|
180
179
|
sx: {
|
|
181
180
|
'.MuiDialog-paper': {
|
|
182
|
-
borderRadius:
|
|
181
|
+
borderRadius: 1,
|
|
183
182
|
maxWidth: 1200,
|
|
184
183
|
},
|
|
185
184
|
'.ux-dialog_title': {
|
|
@@ -328,10 +327,10 @@ export default function UserCenter({
|
|
|
328
327
|
gap: 2.5,
|
|
329
328
|
}}>
|
|
330
329
|
{isMyself ? (
|
|
331
|
-
<Box sx={{ border:
|
|
330
|
+
<Box sx={{ border: '1px solid', borderColor: 'divider', borderRadius: 1.5, p: 2 }}>
|
|
332
331
|
<Typography
|
|
333
332
|
sx={{
|
|
334
|
-
color:
|
|
333
|
+
color: 'text.primary',
|
|
335
334
|
fontWeight: 600,
|
|
336
335
|
mb: 2.5,
|
|
337
336
|
}}>
|
|
@@ -385,7 +384,7 @@ export default function UserCenter({
|
|
|
385
384
|
alignItems: 'center',
|
|
386
385
|
flex: 1,
|
|
387
386
|
}}>
|
|
388
|
-
<CircularProgress
|
|
387
|
+
<CircularProgress />
|
|
389
388
|
</Box>
|
|
390
389
|
);
|
|
391
390
|
}
|
|
@@ -540,7 +539,7 @@ export default function UserCenter({
|
|
|
540
539
|
display: 'block',
|
|
541
540
|
width: '100%',
|
|
542
541
|
height: '1px',
|
|
543
|
-
backgroundColor:
|
|
542
|
+
backgroundColor: 'divider',
|
|
544
543
|
},
|
|
545
544
|
},
|
|
546
545
|
}}
|
|
@@ -550,7 +549,7 @@ export default function UserCenter({
|
|
|
550
549
|
) : null}
|
|
551
550
|
{userCenterTabs.length === 0 && emptyContent}
|
|
552
551
|
</Box>
|
|
553
|
-
{!isMobile && <Divider orientation="vertical" sx={{
|
|
552
|
+
{!isMobile && <Divider orientation="vertical" sx={{ ml: 5 }} />}
|
|
554
553
|
<UserBasicInfo
|
|
555
554
|
isMobile={isMobile}
|
|
556
555
|
order={isMobile ? 1 : 'unset'}
|
|
@@ -5,12 +5,12 @@ import { Box } from '@mui/material';
|
|
|
5
5
|
import { useMemoizedFn } from 'ahooks';
|
|
6
6
|
import { translate } from '@arcblock/ux/lib/Locale/util';
|
|
7
7
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
8
|
-
import { temp as colors } from '@arcblock/ux/lib/Colors';
|
|
9
8
|
import CountrySelect from '@arcblock/ux/lib/PhoneInput/country-select';
|
|
10
9
|
import type { UserAddress } from '../../../@types';
|
|
11
10
|
import { translations } from '../../libs/locales';
|
|
12
11
|
import EditableField from '../editable-field';
|
|
13
12
|
|
|
13
|
+
/** only for sx */
|
|
14
14
|
const selectStyle = {
|
|
15
15
|
width: '100%',
|
|
16
16
|
px: 2,
|
|
@@ -18,11 +18,11 @@ const selectStyle = {
|
|
|
18
18
|
borderRadius: 1,
|
|
19
19
|
'&:hover': {
|
|
20
20
|
'fieldset.MuiOutlinedInput-notchedOutline': {
|
|
21
|
-
borderColor:
|
|
21
|
+
borderColor: 'divider',
|
|
22
22
|
},
|
|
23
23
|
},
|
|
24
24
|
'fieldset.MuiOutlinedInput-notchedOutline': {
|
|
25
|
-
borderColor:
|
|
25
|
+
borderColor: 'divider',
|
|
26
26
|
borderRadius: 1,
|
|
27
27
|
},
|
|
28
28
|
'.MuiSelect-select': {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Box, Button, FormControl, IconButton, TextField, Typography } from '@mui/material';
|
|
2
2
|
import styled from '@emotion/styled';
|
|
3
|
-
|
|
4
|
-
import RemoveIcon from '@arcblock/icons/lib/Subtract';
|
|
3
|
+
import RemoveIcon from '@mui/icons-material/Remove';
|
|
5
4
|
import AddIcon from '@mui/icons-material/Add';
|
|
6
|
-
import { temp as colors } from '@arcblock/ux/lib/Colors';
|
|
7
5
|
import { ChangeEvent, useEffect, useMemo, useState } from 'react';
|
|
8
6
|
import { translate } from '@arcblock/ux/lib/Locale/util';
|
|
9
7
|
import { useMemoizedFn } from 'ahooks';
|
|
@@ -100,7 +98,7 @@ function DynamicLinkForm({ links = [], onChange }: { links: string[]; onChange:
|
|
|
100
98
|
return (
|
|
101
99
|
<Box width="100%">
|
|
102
100
|
<Box display="flex" justifyContent="space-between" alignItems="center" gap={1}>
|
|
103
|
-
<Typography variant="subtitle1" gutterBottom sx={{ mb: 0, fontSize: '12px', color: '
|
|
101
|
+
<Typography variant="subtitle1" gutterBottom sx={{ mb: 0, fontSize: '12px', color: 'text.primary' }}>
|
|
104
102
|
Social Media
|
|
105
103
|
</Typography>
|
|
106
104
|
</Box>
|
|
@@ -112,8 +110,8 @@ function DynamicLinkForm({ links = [], onChange }: { links: string[]; onChange:
|
|
|
112
110
|
onChange={(value) => handleInputChange(index, value)}
|
|
113
111
|
errorMsg={errors[index] ? t('profile.invalidURL') : ''}
|
|
114
112
|
/>
|
|
115
|
-
<IconButton
|
|
116
|
-
<RemoveIcon />
|
|
113
|
+
<IconButton onClick={() => handleRemoveLink(index)}>
|
|
114
|
+
<RemoveIcon sx={{ color: 'text.secondary' }} />
|
|
117
115
|
</IconButton>
|
|
118
116
|
</Box>
|
|
119
117
|
))}
|
|
@@ -126,11 +124,12 @@ function DynamicLinkForm({ links = [], onChange }: { links: string[]; onChange:
|
|
|
126
124
|
size="small"
|
|
127
125
|
sx={{
|
|
128
126
|
height: '40px',
|
|
129
|
-
border:
|
|
130
|
-
|
|
127
|
+
border: '1px dashed',
|
|
128
|
+
borderColor: 'grey.100',
|
|
129
|
+
color: 'text.primary',
|
|
131
130
|
'&:hover': {
|
|
132
|
-
|
|
133
|
-
backgroundColor:
|
|
131
|
+
borderColor: 'grey.100',
|
|
132
|
+
backgroundColor: 'action.hover',
|
|
134
133
|
},
|
|
135
134
|
'&.Mui-disabled': {
|
|
136
135
|
borderStyle: 'dashed',
|
|
@@ -576,7 +576,7 @@ export default function UserMetadataComponent({
|
|
|
576
576
|
PaperProps={{
|
|
577
577
|
sx: {
|
|
578
578
|
boxShadow: '0px -2px 16px 0px rgba(0, 0, 0, 0.08)',
|
|
579
|
-
borderRadius:
|
|
579
|
+
borderRadius: 1.5, // 保持跟 DID Wallet 一致
|
|
580
580
|
borderBottomLeftRadius: 0,
|
|
581
581
|
borderBottomRightRadius: 0,
|
|
582
582
|
},
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { memo } from 'react';
|
|
2
2
|
import { Chip } from '@mui/material';
|
|
3
|
+
import { Icon } from '@iconify/react';
|
|
4
|
+
import SwapHorizRoundedIcon from '@iconify-icons/material-symbols/swap-horiz-rounded';
|
|
3
5
|
import { useCreation } from 'ahooks';
|
|
4
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
5
|
-
import SwitchIcon from '@arcblock/icons/lib/Switch';
|
|
6
|
-
import { temp as colors } from '@arcblock/ux/lib/Colors';
|
|
7
6
|
import type { User } from '../../../@types';
|
|
8
7
|
|
|
9
8
|
function SwitchRole({ user, switchPassport }: { user: User; switchPassport: () => void }) {
|
|
@@ -11,6 +10,7 @@ function SwitchRole({ user, switchPassport }: { user: User; switchPassport: () =
|
|
|
11
10
|
() => (user?.passports || [])?.find((item) => item.name === user.role),
|
|
12
11
|
[user?.passports, user?.role]
|
|
13
12
|
);
|
|
13
|
+
|
|
14
14
|
return (
|
|
15
15
|
<Chip
|
|
16
16
|
label={currentRole?.title || user?.role || 'Guest'}
|
|
@@ -20,21 +20,18 @@ function SwitchRole({ user, switchPassport }: { user: User; switchPassport: () =
|
|
|
20
20
|
flexShrink: 0,
|
|
21
21
|
fontWeight: 'bold',
|
|
22
22
|
fontSize: '12px',
|
|
23
|
-
color:
|
|
24
|
-
borderColor:
|
|
23
|
+
color: 'text.primary',
|
|
24
|
+
borderColor: 'grey.100',
|
|
25
25
|
backgroundColor: 'transparent',
|
|
26
26
|
textTransform: 'capitalize',
|
|
27
27
|
pr: 1,
|
|
28
28
|
pl: 0.5,
|
|
29
|
-
'&:hover': {
|
|
30
|
-
backgroundColor: 'rgba(0, 0, 0, 0.04)',
|
|
31
|
-
},
|
|
32
29
|
'&:active': {
|
|
33
30
|
boxShadow: 'none',
|
|
34
31
|
},
|
|
35
32
|
}}
|
|
36
33
|
clickable
|
|
37
|
-
deleteIcon={<
|
|
34
|
+
deleteIcon={<Icon icon={SwapHorizRoundedIcon} color="inherit" />}
|
|
38
35
|
onDelete={switchPassport}
|
|
39
36
|
onClick={switchPassport}
|
|
40
37
|
/>
|
|
@@ -4,9 +4,7 @@ import Select, { SelectChangeEvent } from '@mui/material/Select';
|
|
|
4
4
|
import ListSubheader from '@mui/material/ListSubheader';
|
|
5
5
|
import TextField from '@mui/material/TextField';
|
|
6
6
|
import debounce from 'lodash/debounce';
|
|
7
|
-
import
|
|
8
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
9
|
-
import ArrowDownwardIcon from '@arcblock/icons/lib/ArrowDown';
|
|
7
|
+
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
|
|
10
8
|
import { getTimezones } from './utils';
|
|
11
9
|
|
|
12
10
|
const timezones = getTimezones();
|
|
@@ -51,7 +49,12 @@ export function TimezoneSelect({ value, onChange, disabled = false, mode = 'self
|
|
|
51
49
|
variant="outlined"
|
|
52
50
|
placeholder="Timezone"
|
|
53
51
|
// eslint-disable-next-line react/no-unstable-nested-components
|
|
54
|
-
IconComponent={(props) =>
|
|
52
|
+
IconComponent={(props) => (
|
|
53
|
+
<KeyboardArrowDownIcon
|
|
54
|
+
{...props}
|
|
55
|
+
sx={{ fontSize: 18, color: (theme) => `${theme.palette.text.secondary} !important` }}
|
|
56
|
+
/>
|
|
57
|
+
)}
|
|
55
58
|
MenuProps={{
|
|
56
59
|
PaperProps: {
|
|
57
60
|
style: {
|
|
@@ -66,11 +69,11 @@ export function TimezoneSelect({ value, onChange, disabled = false, mode = 'self
|
|
|
66
69
|
width: '100%',
|
|
67
70
|
'&:hover': {
|
|
68
71
|
'fieldset.MuiOutlinedInput-notchedOutline': {
|
|
69
|
-
borderColor:
|
|
72
|
+
borderColor: 'divider',
|
|
70
73
|
},
|
|
71
74
|
},
|
|
72
75
|
'fieldset.MuiOutlinedInput-notchedOutline': {
|
|
73
|
-
borderColor:
|
|
76
|
+
borderColor: 'divider',
|
|
74
77
|
},
|
|
75
78
|
}}>
|
|
76
79
|
<ListSubheader>
|
|
@@ -88,14 +91,14 @@ export function TimezoneSelect({ value, onChange, disabled = false, mode = 'self
|
|
|
88
91
|
marginTop: '8px',
|
|
89
92
|
'& .MuiOutlinedInput-root': {
|
|
90
93
|
'& fieldset': {
|
|
91
|
-
borderColor:
|
|
94
|
+
borderColor: 'divider',
|
|
92
95
|
borderWidth: '1px',
|
|
93
96
|
},
|
|
94
97
|
'&:hover fieldset': {
|
|
95
|
-
borderColor:
|
|
98
|
+
borderColor: 'divider',
|
|
96
99
|
},
|
|
97
100
|
'&.Mui-focused fieldset': {
|
|
98
|
-
borderColor:
|
|
101
|
+
borderColor: 'divider',
|
|
99
102
|
},
|
|
100
103
|
},
|
|
101
104
|
}}
|
|
@@ -8,7 +8,6 @@ import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
|
8
8
|
import noop from 'lodash/noop';
|
|
9
9
|
import { useEffect, useState } from 'react';
|
|
10
10
|
import Toast from '@arcblock/ux/lib/Toast';
|
|
11
|
-
import { temp as colors } from '@arcblock/ux/lib/Colors';
|
|
12
11
|
import type { AxiosError } from 'axios';
|
|
13
12
|
import { parseURL, joinURL } from 'ufo';
|
|
14
13
|
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
|
|
@@ -219,7 +218,7 @@ export default function UserBasicInfo({
|
|
|
219
218
|
<UserMetadataComponent isMobile={isMobile} isMyself={isMyself} user={user} onSave={onSave} />
|
|
220
219
|
{isMyself ? (
|
|
221
220
|
<>
|
|
222
|
-
<Divider sx={{ my: isMobile ? 1 : 3
|
|
221
|
+
<Divider sx={{ my: isMobile ? 1 : 3 }} />
|
|
223
222
|
{isMobile && !onlyProfile ? (
|
|
224
223
|
<Box
|
|
225
224
|
sx={{
|
|
@@ -231,9 +230,9 @@ export default function UserBasicInfo({
|
|
|
231
230
|
size="small"
|
|
232
231
|
onClick={toggleExpand}
|
|
233
232
|
sx={{
|
|
234
|
-
backgroundColor:
|
|
233
|
+
backgroundColor: 'grey.50',
|
|
235
234
|
'&:hover': {
|
|
236
|
-
backgroundColor:
|
|
235
|
+
backgroundColor: 'grey.50',
|
|
237
236
|
opacity: 0.8,
|
|
238
237
|
},
|
|
239
238
|
}}>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Box, BoxProps, Typography } from '@mui/material';
|
|
2
2
|
import VerifiedIcon from '@mui/icons-material/Verified';
|
|
3
|
-
import { temp as colors } from '@arcblock/ux/lib/Colors';
|
|
4
3
|
|
|
5
4
|
type TUserInfoItemProps = {
|
|
6
5
|
data: {
|
|
@@ -25,7 +24,7 @@ export default function UserInfoItem({ data, verified, ...rest }: TUserInfoItemP
|
|
|
25
24
|
sx={{
|
|
26
25
|
display: 'flex',
|
|
27
26
|
alignItems: 'center',
|
|
28
|
-
color:
|
|
27
|
+
color: 'text.primary',
|
|
29
28
|
fontSize: '14px',
|
|
30
29
|
gap: 1,
|
|
31
30
|
fontWeight: 500,
|
|
@@ -36,7 +35,7 @@ export default function UserInfoItem({ data, verified, ...rest }: TUserInfoItemP
|
|
|
36
35
|
<Box display="flex" flexDirection="row" alignItems="center">
|
|
37
36
|
<Typography
|
|
38
37
|
sx={{
|
|
39
|
-
color:
|
|
38
|
+
color: 'text.secondary',
|
|
40
39
|
whiteSpace: 'pre-wrap',
|
|
41
40
|
fontSize: '14px',
|
|
42
41
|
}}>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import moment from 'moment-timezone';
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
|
-
import { temp as colors } from '@arcblock/ux/lib/Colors';
|
|
4
3
|
import { DurationEnum, UserMetadata } from '../../../@types';
|
|
5
4
|
|
|
6
5
|
const HOUR = 3600;
|
|
@@ -133,26 +132,27 @@ export const getTimeRemaining = (date: Date) => {
|
|
|
133
132
|
return 0; // 如果时间已过期,返回0
|
|
134
133
|
};
|
|
135
134
|
|
|
135
|
+
// 只支持在 sx 中使用
|
|
136
136
|
export const defaultButtonStyle = {
|
|
137
|
-
color:
|
|
138
|
-
borderColor:
|
|
139
|
-
backgroundColor:
|
|
137
|
+
color: 'text.primary',
|
|
138
|
+
borderColor: 'grey.100',
|
|
139
|
+
backgroundColor: 'background.default',
|
|
140
140
|
'&:hover': {
|
|
141
|
-
borderColor:
|
|
142
|
-
backgroundColor:
|
|
141
|
+
borderColor: 'grey.100',
|
|
142
|
+
backgroundColor: 'action.hover',
|
|
143
143
|
},
|
|
144
144
|
py: 0.5,
|
|
145
|
-
borderRadius:
|
|
145
|
+
borderRadius: 1,
|
|
146
146
|
};
|
|
147
147
|
|
|
148
148
|
export const primaryButtonStyle = {
|
|
149
|
-
color:
|
|
150
|
-
borderColor:
|
|
151
|
-
backgroundColor:
|
|
149
|
+
color: 'primary.contrastText',
|
|
150
|
+
borderColor: 'primary.main',
|
|
151
|
+
backgroundColor: 'primary.main',
|
|
152
152
|
'&:hover': {
|
|
153
|
-
borderColor:
|
|
154
|
-
backgroundColor:
|
|
153
|
+
borderColor: 'primary.main',
|
|
154
|
+
backgroundColor: 'primary.main',
|
|
155
155
|
},
|
|
156
156
|
py: 0.5,
|
|
157
|
-
borderRadius:
|
|
157
|
+
borderRadius: 1,
|
|
158
158
|
};
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
import { useCreation, useMemoizedFn, useReactive } from 'ahooks';
|
|
13
13
|
import noop from 'lodash/noop';
|
|
14
14
|
import isUrl from 'is-url';
|
|
15
|
-
import { temp as colors } from '@arcblock/ux/lib/Colors';
|
|
16
15
|
import { Icon } from '@iconify/react';
|
|
17
16
|
import CloseRoundedIcon from '@iconify-icons/material-symbols/close-rounded';
|
|
18
17
|
import CheckIcon from '@iconify-icons/material-symbols/check';
|
|
@@ -137,9 +136,9 @@ export default function WebhookItem({
|
|
|
137
136
|
}}>
|
|
138
137
|
<Select
|
|
139
138
|
sx={{
|
|
140
|
-
borderRadius:
|
|
139
|
+
borderRadius: 1,
|
|
141
140
|
'&.Mui-disabled': {
|
|
142
|
-
backgroundColor:
|
|
141
|
+
backgroundColor: 'grey.50',
|
|
143
142
|
},
|
|
144
143
|
}}
|
|
145
144
|
disabled={!currentState.edit || currentState.loading}
|
|
@@ -162,9 +161,9 @@ export default function WebhookItem({
|
|
|
162
161
|
sx={{
|
|
163
162
|
flex: 1,
|
|
164
163
|
'.MuiInputBase-root': {
|
|
165
|
-
borderRadius:
|
|
164
|
+
borderRadius: 1,
|
|
166
165
|
'&.Mui-disabled': {
|
|
167
|
-
backgroundColor:
|
|
166
|
+
backgroundColor: 'grey.50',
|
|
168
167
|
},
|
|
169
168
|
},
|
|
170
169
|
}}
|
|
@@ -193,8 +192,9 @@ export default function WebhookItem({
|
|
|
193
192
|
currentState.edit = false;
|
|
194
193
|
})}
|
|
195
194
|
sx={{
|
|
196
|
-
borderRadius:
|
|
197
|
-
border:
|
|
195
|
+
borderRadius: 1,
|
|
196
|
+
border: '1px solid',
|
|
197
|
+
borderColor: 'grey.200',
|
|
198
198
|
}}>
|
|
199
199
|
<Icon icon={CheckIcon} />
|
|
200
200
|
</IconButton>
|
|
@@ -202,8 +202,9 @@ export default function WebhookItem({
|
|
|
202
202
|
color="error"
|
|
203
203
|
onClick={handleClose}
|
|
204
204
|
sx={{
|
|
205
|
-
borderRadius:
|
|
206
|
-
border:
|
|
205
|
+
borderRadius: 1,
|
|
206
|
+
border: '1px solid',
|
|
207
|
+
borderColor: 'grey.200',
|
|
207
208
|
}}>
|
|
208
209
|
<Icon icon={CloseRoundedIcon} />
|
|
209
210
|
</IconButton>
|
|
@@ -215,8 +216,9 @@ export default function WebhookItem({
|
|
|
215
216
|
currentState.edit = true;
|
|
216
217
|
}}
|
|
217
218
|
sx={{
|
|
218
|
-
borderRadius:
|
|
219
|
-
border:
|
|
219
|
+
borderRadius: 1,
|
|
220
|
+
border: '1px solid',
|
|
221
|
+
borderColor: 'grey.200',
|
|
220
222
|
}}>
|
|
221
223
|
<Icon icon={EditSquareOutlineRoundedIcon} />
|
|
222
224
|
</IconButton>
|
|
@@ -229,8 +231,9 @@ export default function WebhookItem({
|
|
|
229
231
|
});
|
|
230
232
|
}}
|
|
231
233
|
sx={{
|
|
232
|
-
borderRadius:
|
|
233
|
-
border:
|
|
234
|
+
borderRadius: 1,
|
|
235
|
+
border: '1px solid',
|
|
236
|
+
borderColor: 'grey.200',
|
|
234
237
|
}}>
|
|
235
238
|
<Icon icon={DeleteOutlineRoundedIcon} />
|
|
236
239
|
</IconButton>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Box, Chip, Tooltip, Typography } from '@mui/material';
|
|
2
2
|
import Avatar from '@arcblock/ux/lib/Avatar';
|
|
3
3
|
import { useCreation } from 'ahooks';
|
|
4
|
-
import { temp as colors } from '@arcblock/ux/lib/Colors';
|
|
5
4
|
|
|
6
5
|
import { User } from '../../@types';
|
|
7
6
|
|
|
@@ -51,8 +50,8 @@ export default function UserSessionInfo({ user, sessionUser }: { readonly user:
|
|
|
51
50
|
flexShrink: 0,
|
|
52
51
|
fontWeight: 'bold',
|
|
53
52
|
fontSize: '12px',
|
|
54
|
-
color:
|
|
55
|
-
borderColor:
|
|
53
|
+
color: 'text.primary',
|
|
54
|
+
borderColor: 'grey.300',
|
|
56
55
|
backgroundColor: 'transparent',
|
|
57
56
|
textTransform: 'capitalize',
|
|
58
57
|
pr: 0.5,
|
|
@@ -8,7 +8,6 @@ import RelativeTime from '@arcblock/ux/lib/RelativeTime';
|
|
|
8
8
|
import UAParser from 'ua-parser-js';
|
|
9
9
|
import { getVisitorId } from '@arcblock/ux/lib/Util';
|
|
10
10
|
import { useConfirm } from '@arcblock/ux/lib/Dialog';
|
|
11
|
-
import { temp as colors } from '@arcblock/ux/lib/Colors';
|
|
12
11
|
import PQueue from 'p-queue';
|
|
13
12
|
import {
|
|
14
13
|
Box,
|
|
@@ -376,6 +375,7 @@ export default function UserSessions({
|
|
|
376
375
|
},
|
|
377
376
|
},
|
|
378
377
|
].filter(Boolean);
|
|
378
|
+
|
|
379
379
|
return (
|
|
380
380
|
<Box
|
|
381
381
|
className="pc-user-sessions"
|
|
@@ -383,20 +383,23 @@ export default function UserSessions({
|
|
|
383
383
|
maxWidth: isMobile ? 'unset' : isLg ? 'calc(100vw - 300px)' : '100%',
|
|
384
384
|
...(isMobile && {
|
|
385
385
|
'.pc-user-sessions-table > div:nth-child(2)': {
|
|
386
|
-
border:
|
|
387
|
-
|
|
386
|
+
border: '1px solid',
|
|
387
|
+
borderColor: 'divider',
|
|
388
|
+
borderRadius: 1,
|
|
388
389
|
},
|
|
389
390
|
}),
|
|
390
391
|
'.MuiTableCell-head': {
|
|
391
392
|
whiteSpace: 'nowrap',
|
|
392
393
|
fontWeight: 'bold',
|
|
394
|
+
backgroundColor: 'background.default',
|
|
393
395
|
},
|
|
394
396
|
'.MuiTableRow-root': {
|
|
395
397
|
border: 'unset',
|
|
398
|
+
backgroundColor: 'background.default',
|
|
396
399
|
'&:nth-child(even)': {
|
|
397
|
-
backgroundColor: '
|
|
400
|
+
backgroundColor: 'grey.50',
|
|
398
401
|
'&:hover': {
|
|
399
|
-
backgroundColor:
|
|
402
|
+
backgroundColor: (theme) => `${theme.palette.grey[50]} !important`,
|
|
400
403
|
},
|
|
401
404
|
},
|
|
402
405
|
},
|
|
@@ -408,6 +411,7 @@ export default function UserSessions({
|
|
|
408
411
|
'.MuiTableCell-root': {
|
|
409
412
|
paddingRight: '8px',
|
|
410
413
|
paddingLeft: '8px',
|
|
414
|
+
color: 'text.secondary',
|
|
411
415
|
...(isMobile && {
|
|
412
416
|
padding: '8px !important',
|
|
413
417
|
'&:first-child': {
|
|
@@ -47,8 +47,8 @@ export default function HeaderAddons({ formattedBlocklet, addons, showDomainWarn
|
|
|
47
47
|
addonsArray.push(<LocaleSelector key="locale-selector" showText={false} />);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
//
|
|
51
|
-
if (
|
|
50
|
+
// 允许切换明暗主题
|
|
51
|
+
if (window.blocklet?.theme?.prefer === 'system') {
|
|
52
52
|
addonsArray.push(<ThemeModeToggle key="theme-mode-toggle" />);
|
|
53
53
|
}
|
|
54
54
|
|