Skip to content

Commit 47ee30e

Browse files
committed
Make images consistent size and minor style fixes
1 parent 797d3c3 commit 47ee30e

4 files changed

Lines changed: 20 additions & 21 deletions

File tree

PennMobile/Subletting/SubletCandidatesView.swift

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,30 @@ import PennMobileShared
1111

1212
struct CandidateRow: View {
1313
let offer: SubletOffer
14-
@State var isMessageShowing = true
1514

1615
var body: some View {
1716
VStack(alignment: .leading, spacing: 10) {
1817
Button(action: {
19-
guard let url = URL(string: "mailto:\(offer.email)") else { return }
20-
UIApplication.shared.open(url)
21-
}) {
22-
Text(offer.email)
23-
.font(.headline)
24-
}
18+
guard let url = URL(string: "mailto:\(offer.email)") else { return }
19+
UIApplication.shared.open(url)
20+
}) {
21+
Text(offer.email)
22+
.font(.headline)
23+
}
24+
2525
HStack {
2626
Image(systemName: "phone")
2727
Button(action: {
28-
guard let url = URL(string: "tel:\(offer.phoneNumber)") else { return }
29-
UIApplication.shared.open(url)
30-
}) {
31-
Text(offer.phoneNumber)
32-
}
28+
guard let url = URL(string: "tel:\(offer.phoneNumber)") else { return }
29+
UIApplication.shared.open(url)
30+
}) {
31+
Text(offer.phoneNumber)
32+
}
3333
}
3434
.font(.subheadline)
3535

36-
if isMessageShowing {
37-
if offer.message != nil {
38-
Text("\"\(offer.message ?? "")\"")
39-
}
36+
if offer.message != nil && !offer.message!.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
37+
Text("\"\(offer.message!)\"")
4038
}
4139

4240
Text("Submitted \(formatDate(offer.createdDate))")

PennMobile/Subletting/SubletDetailView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ struct SubletDetailView: View {
4141
}
4242
.pickerStyle(.segmented)
4343
.customBadge("\(sublet.offers?.count ?? 0)", enabled: sublet.offers?.count ?? 0 > 0)
44-
.padding(.horizontal)
44+
.padding([.horizontal, .top])
4545

4646
// TabView does not like displaying content when inside ScrollView
4747
if selectedTab == "Details" {

PennMobile/Subletting/SubletDisplayRow.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ struct SubletDisplayRow: View {
4242
.resizable()
4343
.aspectRatio(contentMode: .fit)
4444
.cornerRadius(10)
45-
.frame(maxHeight: 120)
45+
.frame(width: 150)
4646
} else {
4747
Color.gray
4848
.aspectRatio(contentMode: .fit)
4949
.cornerRadius(10)
50-
.frame(maxHeight: 120)
50+
.frame(width: 150)
5151
}
5252
} else {
5353
KFImage(URL(string: sublet.images.count > 0 ? sublet.images[0].imageUrl : ""))
@@ -62,7 +62,7 @@ struct SubletDisplayRow: View {
6262
.resizable()
6363
.aspectRatio(contentMode: .fit)
6464
.cornerRadius(10)
65-
.frame(maxHeight: 120)
65+
.frame(width: 150)
6666
}
6767

6868
VStack(alignment: .leading) {

PennMobileShared/Subletting/SubletDisplayBox.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public struct SubletDisplayBox: View {
1818
}
1919

2020
public var body: some View {
21-
VStack(alignment: .leading) {
21+
VStack {
2222
KFImage(URL(string: sublet.images.count > 0 ? sublet.images[0].imageUrl : ""))
2323
.placeholder {
2424
if sublet.images.count > 0 {
@@ -31,6 +31,7 @@ public struct SubletDisplayBox: View {
3131
.resizable()
3232
.aspectRatio(contentMode: .fit)
3333
.cornerRadius(10)
34+
.frame(height: 150)
3435

3536
VStack(alignment: .leading) {
3637
Text(sublet.title)

0 commit comments

Comments
 (0)