Skip to content

Commit cb9294c

Browse files
authored
Expose ChannelAvatarViewOptions.init (#908)
* Expose ChannelAvatarViewOptions.init * Update CHANGELOG.md
1 parent a375af0 commit cb9294c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
33

44
# Upcoming
55

6+
### ✅ Added
7+
- Expose `ChannelAvatarViewOptions.init` [#908](https://github.com/GetStream/stream-chat-swiftui/pull/908)
68
### 🐞 Fixed
79
- Fix WebView error handling to enable mp3 attachments loading [#904](https://github.com/GetStream/stream-chat-swiftui/pull/904)
810

Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelListItem.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,15 @@ public struct ChannelAvatarViewOptions {
181181
/// Whether the online indicator should be shown.
182182
public var showOnlineIndicator: Bool
183183
/// Size of the avatar.
184-
public var size: CGSize = .defaultAvatarSize
184+
public var size: CGSize
185185
/// Optional avatar image. If not provided, it will be loaded by the channel header loader.
186186
public var avatar: UIImage?
187+
188+
public init(showOnlineIndicator: Bool, size: CGSize = .defaultAvatarSize, avatar: UIImage? = nil) {
189+
self.showOnlineIndicator = showOnlineIndicator
190+
self.size = size
191+
self.avatar = avatar
192+
}
187193
}
188194

189195
/// View for the avatar used in channels (includes online indicator overlay).

0 commit comments

Comments
 (0)