Skip to content

Commit e8bec9b

Browse files
Exposed setting width of trailing items in chat channels
1 parent 6ca725b commit e8bec9b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelSwipeableListItem.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public struct ChatChannelSwipeableListItem<Factory: ViewFactory, ChannelListItem
1818

1919
private let numberOfTrailingItems: Int
2020

21-
private let itemWidth: CGFloat = 60
21+
private let itemWidth: CGFloat
2222
private var menuWidth: CGFloat {
2323
itemWidth * CGFloat(numberOfTrailingItems) + 8
2424
}
@@ -47,13 +47,15 @@ public struct ChatChannelSwipeableListItem<Factory: ViewFactory, ChannelListItem
4747
swipedChannelId: Binding<String?>,
4848
channel: ChatChannel,
4949
numberOfTrailingItems: Int = 2,
50+
widthOfTrailingItem: CGFloat = 60,
5051
trailingRightButtonTapped: @escaping (ChatChannel) -> Void,
5152
trailingLeftButtonTapped: @escaping (ChatChannel) -> Void,
5253
leadingSwipeButtonTapped: @escaping (ChatChannel) -> Void
5354
) {
5455
self.factory = factory
5556
self.channelListItem = channelListItem
5657
self.channel = channel
58+
itemWidth = widthOfTrailingItem
5759
self.numberOfTrailingItems = numberOfTrailingItems
5860
self.trailingRightButtonTapped = trailingRightButtonTapped
5961
self.trailingLeftButtonTapped = trailingLeftButtonTapped

0 commit comments

Comments
 (0)