mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 20:05:19 +00:00
Fixing MAC OS build
This commit is contained in:
@@ -15,8 +15,9 @@ struct LinkPreviewView: View {
|
|||||||
let url: URL
|
let url: URL
|
||||||
let title: String?
|
let title: String?
|
||||||
@Environment(\.colorScheme) var colorScheme
|
@Environment(\.colorScheme) var colorScheme
|
||||||
|
#if os(iOS)
|
||||||
@State private var metadata: LPLinkMetadata?
|
@State private var metadata: LPLinkMetadata?
|
||||||
|
#endif
|
||||||
private var textColor: Color {
|
private var textColor: Color {
|
||||||
colorScheme == .dark ? Color.green : Color(red: 0, green: 0.5, blue: 0)
|
colorScheme == .dark ? Color.green : Color(red: 0, green: 0.5, blue: 0)
|
||||||
}
|
}
|
||||||
@@ -85,11 +86,13 @@ struct LinkPreviewView: View {
|
|||||||
|
|
||||||
VStack(alignment: .leading, spacing: 4) {
|
VStack(alignment: .leading, spacing: 4) {
|
||||||
// Title
|
// Title
|
||||||
|
#if os(iOS)
|
||||||
Text(metadata?.title ?? title ?? url.host ?? "Link")
|
Text(metadata?.title ?? title ?? url.host ?? "Link")
|
||||||
.font(.system(size: 14, weight: .semibold, design: .monospaced))
|
.font(.system(size: 14, weight: .semibold, design: .monospaced))
|
||||||
.foregroundColor(textColor)
|
.foregroundColor(textColor)
|
||||||
.lineLimit(2)
|
.lineLimit(2)
|
||||||
.multilineTextAlignment(.leading)
|
.multilineTextAlignment(.leading)
|
||||||
|
#endif
|
||||||
|
|
||||||
// Host
|
// Host
|
||||||
Text(url.host ?? url.absoluteString)
|
Text(url.host ?? url.absoluteString)
|
||||||
@@ -287,4 +290,4 @@ extension String {
|
|||||||
LinkPreviewView(url: URL(string: "https://example.com")!, title: "Example Website")
|
LinkPreviewView(url: URL(string: "https://example.com")!, title: "Example Website")
|
||||||
.padding()
|
.padding()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user