Fix link preview image size

This commit is contained in:
Thomas Ricouard 2023-02-17 19:11:09 +01:00
parent c02cbde72e
commit 88fdeec100

View file

@ -17,17 +17,20 @@ public struct StatusRowCardView: View {
if let title = card.title, let url = URL(string: card.url) { if let title = card.title, let url = URL(string: card.url) {
VStack(alignment: .leading) { VStack(alignment: .leading) {
if let imageURL = card.image { if let imageURL = card.image {
LazyImage(url: imageURL) { state in GeometryReader { proxy in
if let image = state.imageContainer?.image { LazyImage(url: imageURL) { state in
SwiftUI.Image(uiImage: image) if let image = state.imageContainer?.image {
.resizable() SwiftUI.Image(uiImage: image)
.aspectRatio(contentMode: .fill) .resizable()
.frame(height: 200) .aspectRatio(contentMode: .fill)
.clipped() .frame(height: 200)
} else if state.isLoading { .frame(maxWidth: proxy.frame(in: .local).width)
Rectangle() .clipped()
.fill(Color.gray) } else if state.isLoading {
.frame(height: 200) Rectangle()
.fill(Color.gray)
.frame(height: 200)
}
} }
} }
.frame(height: 200) .frame(height: 200)