@arcblock/ux 3.1.31 → 3.1.33
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/NavMenu/products.js +323 -131
- package/lib/UserCard/Cards/social-actions.js +13 -11
- package/lib/UserCard/Content/minimal.js +48 -45
- package/lib/Util/index.js +39 -37
- package/lib/package.json.js +1 -1
- package/package.json +7 -7
- package/src/NavMenu/products.tsx +192 -0
- package/src/UserCard/Cards/social-actions.tsx +5 -3
- package/src/UserCard/Content/minimal.tsx +10 -5
- package/src/Util/index.ts +4 -0
@@ -67,7 +67,7 @@ function Chat({
|
|
67
67
|
session?.login(noop, {
|
68
68
|
openMode: 'redirect',
|
69
69
|
redirect: window.location.href,
|
70
|
-
});
|
70
|
+
});
|
71
71
|
return;
|
72
72
|
}
|
73
73
|
window.open(joinURL(discussKitMountPoint, `/chat/dm/${user?.did}`), '_blank');
|
@@ -87,7 +87,8 @@ function Chat({
|
|
87
87
|
<ButtonWrapper
|
88
88
|
className="user-card__social-actions-chat"
|
89
89
|
variant="outlined"
|
90
|
-
color="
|
90
|
+
color="primary"
|
91
|
+
size="small"
|
91
92
|
onClick={onNavigateToChat}>
|
92
93
|
<Icon icon="tabler:message-dots" style={{ marginRight: 4 }} />
|
93
94
|
{t('chat')}
|
@@ -148,7 +149,8 @@ function Follow({
|
|
148
149
|
<ButtonWrapper
|
149
150
|
className="user-card__social-actions-follow"
|
150
151
|
variant="outlined"
|
151
|
-
color="
|
152
|
+
color="primary"
|
153
|
+
size="small"
|
152
154
|
onClick={handleFollowAction}>
|
153
155
|
{followed ? (
|
154
156
|
<NotificationsOffIcon sx={{ fontSize: 14, mr: 0.5 }} />
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { memo } from 'react';
|
2
|
-
import { Typography, Box } from '@mui/material';
|
2
|
+
import { Typography, Box, useMediaQuery, Divider } from '@mui/material';
|
3
3
|
import { DID } from '../../DID';
|
4
4
|
import { User, UserCardProps } from '../types';
|
5
5
|
import TooltipAvatar from './tooltip-avatar';
|
@@ -31,7 +31,7 @@ function MinimalContent({ ...props }: MinimalContentProps) {
|
|
31
31
|
renderName,
|
32
32
|
...rest
|
33
33
|
} = props;
|
34
|
-
|
34
|
+
const isSmallScreen = useMediaQuery('(max-width:500px)');
|
35
35
|
return (
|
36
36
|
<Box
|
37
37
|
className="user-card__avatar-content"
|
@@ -44,10 +44,12 @@ function MinimalContent({ ...props }: MinimalContentProps) {
|
|
44
44
|
sx={{
|
45
45
|
display: 'flex',
|
46
46
|
justifyContent: 'space-between',
|
47
|
-
|
48
|
-
|
47
|
+
flexDirection: isSmallScreen ? 'column' : 'row',
|
48
|
+
alignItems: isSmallScreen ? 'flex-start' : 'center',
|
49
|
+
gap: isSmallScreen ? 2 : 1,
|
49
50
|
flex: 1,
|
50
51
|
minWidth: 0,
|
52
|
+
flexWrap: 'wrap',
|
51
53
|
}}>
|
52
54
|
<Box sx={{ display: 'flex', justifyContent: 'flex-start', alignItems: 'center', gap: 1, flex: 1 }}>
|
53
55
|
<TooltipAvatar
|
@@ -91,7 +93,10 @@ function MinimalContent({ ...props }: MinimalContentProps) {
|
|
91
93
|
) : null}
|
92
94
|
</Box>
|
93
95
|
</Box>
|
94
|
-
<
|
96
|
+
{isSmallScreen ? <Divider sx={{ width: '100%' }} /> : null}
|
97
|
+
{!renderTopRightContent ? (
|
98
|
+
<SocialActions showSocialActions={rest.showSocialActions} user={user!} session={rest.session} />
|
99
|
+
) : null}
|
95
100
|
</Box>
|
96
101
|
{renderTopRight(renderTopRightContent, topRightMaxWidth)}
|
97
102
|
</Box>
|
package/src/Util/index.ts
CHANGED
@@ -710,6 +710,10 @@ export const compareVersions = (version1: string, version2: string) => {
|
|
710
710
|
* 通过 server 的版本和 ux 的版本共同决定
|
711
711
|
*/
|
712
712
|
export const isSupportFollow = () => {
|
713
|
+
// HACK: 本地开发时,为了测试方便,暂时放开限制
|
714
|
+
if (process.env.NODE_ENV === 'development') {
|
715
|
+
return true;
|
716
|
+
}
|
713
717
|
const serverVersion = getServerVersion();
|
714
718
|
const uxVersion = getUxPackageVersion();
|
715
719
|
const jsSdkVersion = getJsSdkVersion();
|