File tree Expand file tree Collapse file tree
PennMobileShared/Subletting Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,32 +11,30 @@ import PennMobileShared
1111
1212struct 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) ) " )
Original file line number Diff line number Diff 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 " {
Original file line number Diff line number Diff 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) {
Original file line number Diff line number Diff 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)
You can’t perform that action at this time.
0 commit comments