Skip to content

Commit 818f87d

Browse files
committed
feat: add reviews
Signed-off-by: amitamrutiya <amitamrutiya2210@gmail.com>
1 parent 9f6d568 commit 818f87d

1 file changed

Lines changed: 19 additions & 7 deletions

File tree

src/custom/CollaboratorAvatarGroup/CollaboratorAvatarGroup.tsx

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import { ExpandMore } from '@mui/icons-material';
22
import { MouseEvent, useState } from 'react';
33
import { Avatar, AvatarGroup, Popover, Typography } from '../../base';
44
import { CLOUD_URL } from '../../constants/constants';
5-
import { styled } from '../../theme';
5+
import { iconSmall } from '../../constants/iconsSizes';
6+
import { styled, useTheme } from '../../theme';
67
import { CustomTooltip } from '../CustomTooltip';
78

89
interface User {
@@ -18,6 +19,7 @@ interface Users {
1819

1920
interface CollaboratorAvatarGroupProps {
2021
users: Users;
22+
providerUrl: string;
2123
}
2224

2325
interface StyledAvatarProps {
@@ -28,7 +30,7 @@ const StyledAvatar = styled(Avatar)<StyledAvatarProps>(({ theme, borderColor })
2830
width: theme.spacing(4),
2931
height: theme.spacing(4),
3032
cursor: 'pointer',
31-
border: `1.25px solid ${borderColor} !important`
33+
border: `2px solid ${borderColor} !important`
3234
};
3335
});
3436

@@ -70,7 +72,10 @@ const StyledPopover = styled(Popover)(() => ({
7072
}
7173
}));
7274

73-
const CollaboratorAvatarGroup = ({ users }: CollaboratorAvatarGroupProps): JSX.Element => {
75+
const CollaboratorAvatarGroup = ({
76+
users,
77+
providerUrl
78+
}: CollaboratorAvatarGroupProps): JSX.Element => {
7479
const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);
7580

7681
const openInNewTab = (url: string): void => {
@@ -87,7 +92,7 @@ const CollaboratorAvatarGroup = ({ users }: CollaboratorAvatarGroupProps): JSX.E
8792

8893
const totalUsers = Object.entries(users).length;
8994
const visibleAvatars = 4;
90-
95+
const theme = useTheme();
9196
return (
9297
<AvatarGroup max={visibleAvatars + 1}>
9398
{Object.entries(users)
@@ -101,7 +106,7 @@ const CollaboratorAvatarGroup = ({ users }: CollaboratorAvatarGroupProps): JSX.E
101106
src={user.avatar_url}
102107
borderColor={user.border_color}
103108
imgProps={{ referrerPolicy: 'no-referrer' }}
104-
onClick={() => openInNewTab(`https://${CLOUD_URL}/user/${user.user_id}`)}
109+
onClick={() => openInNewTab(`${providerUrl}/user/${user.user_id}`)}
105110
/>
106111
</CustomTooltip>
107112
);
@@ -110,9 +115,16 @@ const CollaboratorAvatarGroup = ({ users }: CollaboratorAvatarGroupProps): JSX.E
110115
<>
111116
<MoreAvatarButton onClick={handleClick} aria-describedby="user-popover">
112117
{anchorEl ? (
113-
<ExpandMore fill="#fff" width={20} height={20} style={{ marginLeft: '4px' }} />
118+
<ExpandMore
119+
fill={theme.palette.common.white}
120+
{...iconSmall}
121+
style={{ marginLeft: '4px' }}
122+
/>
114123
) : (
115-
<Typography variant="body2" style={{ color: '#fff', fontSize: '12px' }}>
124+
<Typography
125+
variant="body2"
126+
style={{ color: theme.palette.common.white, fontSize: '12px' }}
127+
>
116128
{`+${totalUsers - visibleAvatars}`}
117129
</Typography>
118130
)}

0 commit comments

Comments
 (0)