Skip to content

Commit 476edb9

Browse files
Exposed video view components as public
1 parent 1df2fe7 commit 476edb9

File tree

5 files changed

+31
-4
lines changed

5 files changed

+31
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1010
- Fixed a bug with channel list refreshing after deeplinking
1111
- Navigation bar iPad resizing issue
1212

13+
### 🔄 Changed
14+
- Docs restructuring
15+
- Exposed some view components as public
16+
1317
# [4.19.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.19.0)
1418
_July 21, 2022_
1519

Sources/StreamChatSwiftUI/ChatChannel/Composer/AttachmentUploadingStateView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ extension View {
8383
/// - Parameters:
8484
/// - uploadState: the upload state of the asset.
8585
/// - url: the url of the asset.
86-
func withUploadingStateIndicator(for uploadState: AttachmentUploadingState?, url: URL) -> some View {
86+
public func withUploadingStateIndicator(for uploadState: AttachmentUploadingState?, url: URL) -> some View {
8787
modifier(AttachmentUploadingStateViewModifier(uploadState: uploadState, url: url))
8888
}
8989
}

Sources/StreamChatSwiftUI/ChatChannel/Gallery/VideoPlayerView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public struct VideoPlayerView: View {
1919

2020
private let avPlayer: AVPlayer
2121

22-
init(
22+
public init(
2323
attachment: ChatMessageVideoAttachment,
2424
author: ChatUser,
2525
isShown: Binding<Bool>

Sources/StreamChatSwiftUI/ChatChannel/MessageList/ImageAttachmentView.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,17 @@ public struct ImageAttachmentContainer<Factory: ViewFactory>: View {
7575
}
7676
}
7777

78-
struct AttachmentTextView: View {
78+
public struct AttachmentTextView: View {
7979

8080
@Injected(\.colors) private var colors
8181

8282
var message: ChatMessage
8383

84-
var body: some View {
84+
public init(message: ChatMessage) {
85+
self.message = message
86+
}
87+
88+
public var body: some View {
8589
HStack {
8690
Text(message.adjustedText)
8791
.standardPadding()

Sources/StreamChatSwiftUI/ChatChannel/MessageList/VideoAttachmentView.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ public struct VideoAttachmentsList: View {
6363
let message: ChatMessage
6464
let width: CGFloat
6565

66+
public init(message: ChatMessage, width: CGFloat) {
67+
self.message = message
68+
self.width = width
69+
}
70+
6671
public var body: some View {
6772
VStack {
6873
ForEach(message.videoAttachments, id: \.self) { attachment in
@@ -88,6 +93,20 @@ public struct VideoAttachmentView: View {
8893
var ratio: CGFloat = 0.75
8994
var cornerRadius: CGFloat = 24
9095

96+
public init(
97+
attachment: ChatMessageVideoAttachment,
98+
message: ChatMessage,
99+
width: CGFloat,
100+
ratio: CGFloat = 0.75,
101+
cornerRadius: CGFloat = 24
102+
) {
103+
self.attachment = attachment
104+
self.message = message
105+
self.width = width
106+
self.ratio = ratio
107+
self.cornerRadius = cornerRadius
108+
}
109+
91110
@State var previewImage: UIImage?
92111
@State var error: Error?
93112
@State var fullScreenShown = false

0 commit comments

Comments
 (0)