Browse Source

Changed the layout of the image to be a bit more UI friendly

Changelog-Changed: Show rounded corners on inline images
post-button-style
Sam DuBois 2 years ago
committed by William Casarin
parent
commit
4a83d370d2
  1. 28
      damus/Components/ImageCarousel.swift

28
damus/Components/ImageCarousel.swift

@ -121,21 +121,25 @@ struct ImageCarousel: View {
var body: some View {
TabView {
ForEach(urls, id: \.absoluteString) { url in
KFAnimatedImage(url)
.configure { view in
view.framePreloadCount = 3
Rectangle()
.overlay {
KFAnimatedImage(url)
.configure { view in
view.framePreloadCount = 3
}
.cacheOriginalImage()
.loadDiskFileSynchronously()
.scaleFactor(UIScreen.main.scale)
.fade(duration: 0.1)
.aspectRatio(contentMode: .fill)
.tabItem {
Text(url.absoluteString)
}
.id(url.absoluteString)
}
.cacheOriginalImage()
.loadDiskFileSynchronously()
.scaleFactor(UIScreen.main.scale)
.fade(duration: 0.1)
.aspectRatio(contentMode: .fit)
.tabItem {
Text(url.absoluteString)
}
.id(url.absoluteString)
}
}
.cornerRadius(10)
.sheet(isPresented: $open_sheet) {
ImageViewer(urls: urls)
}

Loading…
Cancel
Save