fix user avatar in chat
This commit is contained in:
parent
b05d7de840
commit
1dca8ace94
@ -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}>
|
||||
|
@ -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 ================
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user