File tree Expand file tree Collapse file tree 3 files changed +21
-6
lines changed
Sources/StreamChatSwiftUI Expand file tree Collapse file tree 3 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -74,15 +74,20 @@ struct MessageDateView: View {
74
74
}
75
75
76
76
/// View that displays the read indicator for a message.
77
- struct MessageReadIndicatorView : View {
77
+ public struct MessageReadIndicatorView : View {
78
78
@Injected ( \. images) private var images
79
79
@Injected ( \. fonts) private var fonts
80
80
@Injected ( \. colors) private var colors
81
81
82
82
var readUsers : [ ChatUser ]
83
83
var showReadCount : Bool
84
84
85
- var body : some View {
85
+ public init ( readUsers: [ ChatUser ] , showReadCount: Bool ) {
86
+ self . readUsers = readUsers
87
+ self . showReadCount = showReadCount
88
+ }
89
+
90
+ public var body : some View {
86
91
HStack ( spacing: 2 ) {
87
92
if showReadCount && !readUsers. isEmpty {
88
93
Text ( " \( readUsers. count) " )
Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ public struct SubtitleText: View {
11
11
12
12
var text : String
13
13
14
+ public init ( text: String ) {
15
+ self . text = text
16
+ }
17
+
14
18
public var body : some View {
15
19
Text ( text)
16
20
. lineLimit ( 1 )
@@ -56,14 +60,18 @@ public struct AvatarView: View {
56
60
}
57
61
}
58
62
59
- struct ChatTitleView : View {
63
+ public struct ChatTitleView : View {
60
64
61
65
@Injected ( \. fonts) private var fonts
62
66
@Injected ( \. colors) private var colors
63
67
64
68
var name : String
65
69
66
- var body : some View {
70
+ public init ( name: String ) {
71
+ self . name = name
72
+ }
73
+
74
+ public var body : some View {
67
75
Text ( name)
68
76
. lineLimit ( 1 )
69
77
. font ( fonts. bodyBold)
Original file line number Diff line number Diff line change 5
5
import SwiftUI
6
6
7
7
/// View shown when other users are typing.
8
- struct TypingIndicatorView : View {
8
+ public struct TypingIndicatorView : View {
9
9
10
10
@State private var isTyping = false
11
11
12
12
private let animationDuration : CGFloat = 0.75
13
13
14
- var body : some View {
14
+ public init ( ) { /* Public init */ }
15
+
16
+ public var body : some View {
15
17
HStack ( spacing: 4 ) {
16
18
TypingIndicatorCircle ( isTyping: isTyping)
17
19
. animation (
You can’t perform that action at this time.
0 commit comments