Skip to content

Commit c308ff2

Browse files
committed
update CustomAvatar usage
1 parent 2e454ba commit c308ff2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/components/Chat/index.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,11 @@ const Chat = ({
242242
renderCustomView={(props: BubbleProps<ICustomMessage>) => (
243243
<CustomUsernameView {...props} activeRoom={activeRoom} />
244244
)}
245-
renderAvatar={(props) => (
246-
<CustomAvatar {...props} activeRoom={activeRoom} />
247-
)}
245+
renderAvatar={(props) =>
246+
activeRoom?.groupAvatar && (
247+
<CustomAvatar {...props} activeRoom={activeRoom} />
248+
)
249+
}
248250
renderAvatarOnTop={true}
249251
renderChatFooter={renderChatFooter}
250252
renderSystemMessage={CustomSystemMessage}

src/components/CustomAvatar/index.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ interface CustomAvatarProps extends AvatarProps<IMessage> {
1111
const CustomAvatar = (props: CustomAvatarProps) => {
1212
const theme = useTheme();
1313
// render user avatar just for community chat
14-
if (props.activeRoom?.groupAvatar) {
15-
return <Avatar {...props} imageStyle={styles(theme).avatarImageStle} />;
16-
}
14+
return <Avatar {...props} imageStyle={styles(theme).avatarImageStle} />;
1715
};
1816

1917
export default CustomAvatar;

0 commit comments

Comments
 (0)