Skip to content

Commit 29f691e

Browse files
Made ComposerInputView initializer public
1 parent 13cfa24 commit 29f691e

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

Sources/StreamChatSwiftUI/ChatChannel/Composer/MessageComposerView.swift

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ public struct MessageComposerView<Factory: ViewFactory>: View, KeyboardReadable
185185

186186
/// View for the composer's input (text and media).
187187
public struct ComposerInputView<Factory: ViewFactory>: View {
188+
188189
@Injected(\.colors) private var colors
189190
@Injected(\.fonts) private var fonts
190191
@Injected(\.images) private var images
@@ -204,6 +205,34 @@ public struct ComposerInputView<Factory: ViewFactory>: View {
204205

205206
@State var textHeight: CGFloat = TextSizeConstants.minimumHeight
206207

208+
public init(
209+
factory: Factory,
210+
text: Binding<String>,
211+
selectedRangeLocation: Binding<Int>,
212+
command: Binding<ComposerCommand?>,
213+
addedAssets: [AddedAsset],
214+
addedFileURLs: [URL],
215+
addedCustomAttachments: [CustomAttachment],
216+
quotedMessage: Binding<ChatMessage?>,
217+
maxMessageLength: Int? = nil,
218+
cooldownDuration: Int,
219+
onCustomAttachmentTap: @escaping (CustomAttachment) -> Void,
220+
removeAttachmentWithId: @escaping (String) -> Void
221+
) {
222+
self.factory = factory
223+
_text = text
224+
_selectedRangeLocation = selectedRangeLocation
225+
_command = command
226+
self.addedAssets = addedAssets
227+
self.addedFileURLs = addedFileURLs
228+
self.addedCustomAttachments = addedCustomAttachments
229+
self.quotedMessage = quotedMessage
230+
self.maxMessageLength = maxMessageLength
231+
self.cooldownDuration = cooldownDuration
232+
self.onCustomAttachmentTap = onCustomAttachmentTap
233+
self.removeAttachmentWithId = removeAttachmentWithId
234+
}
235+
207236
var textFieldHeight: CGFloat {
208237
let minHeight: CGFloat = TextSizeConstants.minimumHeight
209238
let maxHeight: CGFloat = TextSizeConstants.maximumHeight

0 commit comments

Comments
 (0)