1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-04 00:18:01 +01:00

fix: Update avatar usage in change requests (#7818)

This commit is contained in:
Thomas Heartman 2024-08-09 09:54:16 +02:00 committed by GitHub
parent 2f92dac14e
commit 258909db39
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 14 additions and 17 deletions

View File

@ -1,6 +1,6 @@
import type React from 'react';
import type { FC } from 'react';
import { Box, styled, TextField, Tooltip } from '@mui/material';
import { Box, styled, TextField } from '@mui/material';
import { StyledAvatar } from './StyledAvatar';
import type { IUser } from 'interfaces/user';
@ -18,9 +18,7 @@ export const AddCommentField: FC<{
}> = ({ user, commentText, onTypeComment, children }) => (
<>
<AddCommentWrapper>
<Tooltip title={user?.name || user?.username}>
<StyledAvatar src={user?.imageUrl || ''} />
</Tooltip>
<StyledAvatar user={user} />
<TextField
variant='outlined'
placeholder='Add your comment here'

View File

@ -1,7 +1,7 @@
import type { FC } from 'react';
import { Markdown } from 'component/common/Markdown/Markdown';
import Paper from '@mui/material/Paper';
import { Box, styled, Typography, Tooltip } from '@mui/material';
import { Box, styled, Typography } from '@mui/material';
import TimeAgo from 'react-timeago';
import { StyledAvatar } from './StyledAvatar';
import type { IChangeRequestComment } from '../../changeRequest.types';
@ -29,9 +29,7 @@ export const ChangeRequestComment: FC<{ comment: IChangeRequestComment }> = ({
comment,
}) => (
<ChangeRequestCommentWrapper>
<Tooltip title={comment.createdBy.username}>
<StyledAvatar src={comment.createdBy.imageUrl} />
</Tooltip>
<StyledAvatar user={comment.createdBy} />
<CommentPaper variant='outlined'>
<CommentHeader>
<Box>

View File

@ -1,6 +1,7 @@
import { Avatar, styled } from '@mui/material';
import { styled } from '@mui/material';
import { UserAvatar } from 'component/common/UserAvatar/UserAvatar';
export const StyledAvatar = styled(Avatar)(({ theme }) => ({
export const StyledAvatar = styled(UserAvatar)(({ theme }) => ({
height: '32px',
width: '32px',
marginTop: theme.spacing(1),

View File

@ -1,5 +1,6 @@
import { styled } from '@mui/material';
import { Avatar, Box, Card, Paper, Typography } from '@mui/material';
import { Box, Card, Paper, Typography } from '@mui/material';
import { UserAvatar } from 'component/common/UserAvatar/UserAvatar';
export const StyledPaper = styled(Paper)(({ theme }) => ({
padding: theme.spacing(3, 4),
@ -29,7 +30,8 @@ export const StyledCard = styled(Card)(({ theme }) => ({
backgroundColor: theme.palette.background.elevation2,
}));
export const StyledAvatar = styled(Avatar)(({ theme }) => ({
export const StyledAvatar = styled(UserAvatar)(({ theme }) => ({
height: '24px',
width: '24px',
marginInline: 0,
}));

View File

@ -51,9 +51,7 @@ export const ChangeRequestHeader: FC<{ changeRequest: ChangeRequestType }> = ({
})}
>
<Tooltip title={changeRequest?.createdBy?.username}>
<StyledAvatar
src={changeRequest?.createdBy?.imageUrl}
/>
<StyledAvatar user={changeRequest?.createdBy} />
</Tooltip>
</Box>
<Typography

View File

@ -40,7 +40,7 @@ export const ChangeRequestApprover: FC<IChangeRequestReviewerProps> = ({
}) => {
return (
<StyledBox>
<StyledAvatar src={imageUrl} />
<StyledAvatar user={{ name, imageUrl }} />
<ReviewerName variant='body1'>{name}</ReviewerName>
<StyledSuccessIcon />
</StyledBox>
@ -53,7 +53,7 @@ export const ChangeRequestRejector: FC<IChangeRequestReviewerProps> = ({
}) => {
return (
<StyledBox>
<StyledAvatar src={imageUrl} />
<StyledAvatar user={{ name, imageUrl }} />
<ReviewerName variant='body1'>{name}</ReviewerName>
<StyledErrorIcon />
</StyledBox>