Skip to content

Commit

Permalink
fix: [Message] apply user.name to avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
akai committed May 14, 2021
1 parent 669531a commit 3346bf9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/Message/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Typing } from '../Typing';

type User = {
avatar?: string;
name?: string;
};

export type MessageId = string | number;
Expand Down Expand Up @@ -62,7 +63,7 @@ const Message = (props: MessageProps) => {
</div>
)}
<div className="Message-content" role="alert" aria-live="assertive" aria-atomic="false">
{user && user.avatar && <Avatar src={user.avatar} shape="square" />}
{user && user.avatar && <Avatar src={user.avatar} shape="square" alt={user.name} />}
{type === 'typing' ? <Typing /> : renderMessageContent(msg)}
</div>
</div>
Expand Down

0 comments on commit 3346bf9

Please sign in to comment.