Skip to content

Commit 9182a32

Browse files
MessageContainerView made public
1 parent ec6d25a commit 9182a32

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageContainerView.swift

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import NukeUI
88
import StreamChat
99
import SwiftUI
1010

11-
struct MessageContainerView<Factory: ViewFactory>: View {
11+
public struct MessageContainerView<Factory: ViewFactory>: View {
12+
1213
@Injected(\.fonts) private var fonts
1314
@Injected(\.colors) private var colors
1415
@Injected(\.images) private var images
@@ -34,7 +35,31 @@ struct MessageContainerView<Factory: ViewFactory>: View {
3435
private let replyThreshold: CGFloat = 60
3536
private let paddingValue: CGFloat = 8
3637

37-
var body: some View {
38+
public init(
39+
factory: Factory,
40+
channel: ChatChannel,
41+
message: ChatMessage,
42+
width: CGFloat? = nil,
43+
showsAllInfo: Bool,
44+
isInThread: Bool,
45+
isLast: Bool,
46+
scrolledId: Binding<String?>,
47+
quotedMessage: Binding<ChatMessage?>,
48+
onLongPress: @escaping (MessageDisplayInfo) -> Void
49+
) {
50+
self.factory = factory
51+
self.channel = channel
52+
self.message = message
53+
self.width = width
54+
self.showsAllInfo = showsAllInfo
55+
self.isInThread = isInThread
56+
self.isLast = isLast
57+
self.onLongPress = onLongPress
58+
_scrolledId = scrolledId
59+
_quotedMessage = quotedMessage
60+
}
61+
62+
public var body: some View {
3863
HStack(alignment: .bottom) {
3964
if message.type == .system {
4065
factory.makeSystemMessageView(message: message)

0 commit comments

Comments
 (0)