Skip to content

Commit

Permalink
Fix sublet detail images not appearing
Browse files Browse the repository at this point in the history
  • Loading branch information
JHawk0224 committed Apr 15, 2024
1 parent 13458e8 commit 0547781
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
6 changes: 3 additions & 3 deletions PennMobile/Subletting/SubletDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ struct SubletDetailOnly: View {
ForEach(sublet.images) { image in
KFImage(URL(string: image.imageUrl))
.placeholder {
Color.gray
.aspectRatio(contentMode: .fit)
ProgressView()
}
.resizable()
.aspectRatio(contentMode: .fit)
.cornerRadius(10)
}
}
.tabViewStyle(PageTabViewStyle(indexDisplayMode: .never))
.tabViewStyle(.page(indexDisplayMode: .never))
.frame(height: 300)

VStack(alignment: .leading) {
HStack {
Expand Down
8 changes: 6 additions & 2 deletions PennMobile/Subletting/SubletDisplayRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ struct SubletDisplayRow: View {
} else {
KFImage(URL(string: sublet.images.count > 0 ? sublet.images[0].imageUrl : ""))
.placeholder {
Color.gray
.aspectRatio(contentMode: .fill)
if sublet.images.count > 0 {
ProgressView()
} else {
Color.gray
.aspectRatio(contentMode: .fill)
}
}
.resizable()
.aspectRatio(contentMode: .fit)
Expand Down
8 changes: 6 additions & 2 deletions PennMobileShared/Subletting/SubletDisplayBox.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ public struct SubletDisplayBox: View {
VStack(alignment: .leading) {
KFImage(URL(string: sublet.images.count > 0 ? sublet.images[0].imageUrl : ""))
.placeholder {
Color.gray
.aspectRatio(contentMode: .fill)
if sublet.images.count > 0 {
ProgressView()
} else {
Color.gray
.aspectRatio(contentMode: .fill)
}
}
.resizable()
.aspectRatio(contentMode: .fit)
Expand Down

0 comments on commit 0547781

Please sign in to comment.