diff --git a/package/src/components/ChannelPreview/ChannelAvatar.tsx b/package/src/components/ChannelPreview/ChannelAvatar.tsx index 6c8826f79..5216393e3 100644 --- a/package/src/components/ChannelPreview/ChannelAvatar.tsx +++ b/package/src/components/ChannelPreview/ChannelAvatar.tsx @@ -12,7 +12,12 @@ import { GroupAvatar } from '../Avatar/GroupAvatar'; export type ChannelAvatarProps< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, -> = Pick, 'channel'>; +> = Pick, 'channel'> & { + /** + * The size of the avatar. + */ + size?: number; +}; /** * This UI component displays an avatar for a particular channel. @@ -22,15 +27,17 @@ export const ChannelAvatarWithContext = < >( props: ChannelAvatarProps & Pick, ) => { - const { channel, ImageComponent } = props; + const { channel, ImageComponent, size: propSize } = props; const { theme: { channelPreview: { - avatar: { size }, + avatar: { size: themeSize }, }, }, } = useTheme(); + const size = propSize || themeSize; + const displayAvatar = useChannelPreviewDisplayAvatar(channel); const displayPresence = useChannelPreviewDisplayPresence(channel);