Skip to content

Commit 45d0e63

Browse files
LinkAttachmentView and LinkDetectionTextView available for public use
1 parent d32ea63 commit 45d0e63

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
55

66
### ✅ Added
77
- Added markdown support (enabled by default)
8+
- `LinkAttachmentView` and `LinkDetectionTextView` available for public use
89

910
# [4.51.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.51.0)
1011
_March 26, 2024_

Sources/StreamChatSwiftUI/ChatChannel/MessageList/LinkAttachmentView.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ public struct LinkAttachmentView: View {
9898
var linkAttachment: ChatMessageLinkAttachment
9999
var width: CGFloat
100100
var isFirst: Bool
101+
102+
public init(linkAttachment: ChatMessageLinkAttachment, width: CGFloat, isFirst: Bool) {
103+
self.linkAttachment = linkAttachment
104+
self.width = width
105+
self.isFirst = isFirst
106+
}
101107

102108
public var body: some View {
103109
VStack(alignment: .leading, spacing: padding) {

Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ struct StreamTextView: View {
240240
}
241241

242242
@available(iOS 15, *)
243-
struct LinkDetectionTextView: View {
243+
public struct LinkDetectionTextView: View {
244244

245245
@Injected(\.colors) var colors
246246
@Injected(\.fonts) var fonts
@@ -258,15 +258,15 @@ struct LinkDetectionTextView: View {
258258

259259
@State var tintColor = InjectedValues[\.colors].tintColor
260260

261-
init(message: ChatMessage) {
261+
public init(message: ChatMessage) {
262262
self.message = message
263263
}
264264

265265
private var markdownEnabled: Bool {
266266
utils.messageListConfig.markdownSupportEnabled
267267
}
268268

269-
var body: some View {
269+
public var body: some View {
270270
Group {
271271
if let displayedText {
272272
Text(displayedText)

0 commit comments

Comments
 (0)