55import StreamChat
66import SwiftUI
77
8- struct ChatChannelInfoButton : View {
8+ public struct ChatChannelInfoButton : View {
99
1010 @Injected ( \. colors) private var colors
1111 @Injected ( \. fonts) private var fonts
@@ -14,8 +14,15 @@ struct ChatChannelInfoButton: View {
1414 var iconName : String
1515 var foregroundColor : Color
1616 var buttonTapped : ( ) -> Void
17-
18- var body : some View {
17+
18+ public init ( title: String , iconName: String , foregroundColor: Color , buttonTapped: @escaping ( ) -> Void ) {
19+ self . title = title
20+ self . iconName = iconName
21+ self . foregroundColor = foregroundColor
22+ self . buttonTapped = buttonTapped
23+ }
24+
25+ public var body : some View {
1926 Button {
2027 buttonTapped ( )
2128 } label: {
@@ -43,15 +50,19 @@ struct ChannelInfoDivider: View {
4350 }
4451}
4552
46- struct ChatInfoOptionsView : View {
47-
53+ public struct ChatInfoOptionsView : View {
54+
4855 @Injected ( \. images) private var images
4956 @Injected ( \. colors) private var colors
5057 @Injected ( \. fonts) private var fonts
5158
5259 @StateObject var viewModel : ChatChannelInfoViewModel
60+
61+ public init ( viewModel: ChatChannelInfoViewModel ) {
62+ _viewModel = StateObject ( wrappedValue: viewModel)
63+ }
5364
54- var body : some View {
65+ public var body : some View {
5566 VStack ( spacing: 0 ) {
5667 if !viewModel. channel. isDirectMessageChannel {
5768 ChannelNameUpdateView ( viewModel: viewModel)
0 commit comments