fix user avatar in chat

This commit is contained in:
Ramón Souza 2023-09-21 17:12:23 -03:00
parent b05d7de840
commit 1dca8ace94
2 changed files with 3 additions and 2 deletions

View File

@ -146,7 +146,7 @@ const ChatMesssage: React.FC<ChatMessageProps> = ({
color={messageContent.color}
moderator={messageContent.isModerator}
>
{messageContent.name.toLowerCase().slice(0, 2) || ' '}
{message.user?.avatar.length === 0 ? messageContent.name.toLowerCase().slice(0, 2) || '' : ''}
</ChatAvatar>
)}
<ChatContent sameSender={message?.user ? sameSender : false}>

View File

@ -120,10 +120,11 @@ export const ChatAvatar = styled.div<ChatAvatarProps>`
`}
// ================ image ================
${({ avatar, emoji }) => avatar?.length !== 0 && !emoji && css`
${({ avatar, emoji, color }) => avatar?.length !== 0 && !emoji && css`
background-image: url(${avatar});
background-repeat: no-repeat;
background-size: contain;
border: 2px solid ${color};
`}
// ================ image ================