5
5
import StreamChat
6
6
import SwiftUI
7
7
8
- struct ChatChannelInfoButton : View {
8
+ public struct ChatChannelInfoButton : View {
9
9
10
10
@Injected ( \. colors) private var colors
11
11
@Injected ( \. fonts) private var fonts
@@ -14,8 +14,15 @@ struct ChatChannelInfoButton: View {
14
14
var iconName : String
15
15
var foregroundColor : Color
16
16
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 {
19
26
Button {
20
27
buttonTapped ( )
21
28
} label: {
@@ -43,15 +50,19 @@ struct ChannelInfoDivider: View {
43
50
}
44
51
}
45
52
46
- struct ChatInfoOptionsView : View {
47
-
53
+ public struct ChatInfoOptionsView : View {
54
+
48
55
@Injected ( \. images) private var images
49
56
@Injected ( \. colors) private var colors
50
57
@Injected ( \. fonts) private var fonts
51
58
52
59
@StateObject var viewModel : ChatChannelInfoViewModel
60
+
61
+ public init ( viewModel: ChatChannelInfoViewModel ) {
62
+ _viewModel = StateObject ( wrappedValue: viewModel)
63
+ }
53
64
54
- var body : some View {
65
+ public var body : some View {
55
66
VStack ( spacing: 0 ) {
56
67
if !viewModel. channel. isDirectMessageChannel {
57
68
ChannelNameUpdateView ( viewModel: viewModel)
0 commit comments