Skip to content

Commit

Permalink
Make ChatChannelScreen init public
Browse files Browse the repository at this point in the history
  • Loading branch information
laevandus committed Oct 9, 2024
1 parent ab2ecce commit 2859787
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Sources/StreamChatSwiftUI/ChatChannel/ChatChannelScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@ import StreamChat
import SwiftUI

/// Screen component for the chat channel view.
public struct ChatChannelScreen: View {
public var chatChannelController: ChatChannelController
public struct ChatChannelScreen<Factory>: View where Factory: ViewFactory {
public let chatChannelController: ChatChannelController
private let viewFactory: Factory

public init(
chatChannelController: ChatChannelController,
viewFactory: Factory = DefaultViewFactory.shared
) {
self.chatChannelController = chatChannelController
self.viewFactory = viewFactory
}

public var body: some View {
ChatChannelView(
viewFactory: DefaultViewFactory.shared,
viewFactory: viewFactory,
channelController: chatChannelController
)
}
Expand Down

0 comments on commit 2859787

Please sign in to comment.