@@ -20,14 +20,19 @@ struct MapMarkerDetailSwiftView: View {
20
20
HStack {
21
21
colorAccentBar
22
22
23
- VStack ( alignment: . leading, spacing: 8 ) {
23
+ VStack ( alignment: . leading, spacing: 4 ) {
24
24
headerView
25
25
Spacer ( )
26
26
descriptionView
27
+ . padding ( . top, 2 )
27
28
Spacer ( )
28
29
infoRowView
30
+ . padding ( [ . bottom, . trailing] , 8 )
31
+
29
32
}
30
- . padding ( 10 )
33
+ . padding ( . vertical, 8 )
34
+ . padding ( . horizontal, 10 )
35
+ Spacer ( )
31
36
}
32
37
. background ( Color ( . systemBackground) )
33
38
. clipShape ( RoundedRectangle ( cornerRadius: 12 ) )
@@ -39,56 +44,56 @@ struct MapMarkerDetailSwiftView: View {
39
44
}
40
45
41
46
42
- // MARK: - Private Views
47
+ // MARK: - Private Views
43
48
44
49
private var colorAccentBar : some View {
45
50
let markerColor : Color = {
46
51
guard let marker else {
47
52
return . purple
48
53
}
49
-
54
+
50
55
switch marker. type {
51
- case . known( let type) :
52
- return Color ( type. color ( ) )
53
- case . unknown:
54
- return Color ( BMColor . MapMarker. other)
56
+ case . known( let type) :
57
+ return Color ( type. color ( ) )
58
+ case . unknown:
59
+ return Color ( BMColor . MapMarker. other)
55
60
}
56
61
} ( )
57
62
58
63
return Rectangle ( )
59
- . fill ( markerColor)
60
- . frame ( width: 12 )
64
+ . fill ( markerColor)
65
+ . frame ( width: 12 )
61
66
}
62
67
63
68
private var headerView : some View {
64
69
HStack {
65
- Text ( marker? . title ?? " Unknown " )
66
- . font ( Font ( BMFont . bold ( 25 ) ) )
70
+ Text ( ( marker? . title ?? " Unknown " ) . capitalized )
71
+ . font ( Font ( BMFont . bold ( 21 ) ) )
67
72
. foregroundColor ( . primary)
68
- . lineLimit ( 1 )
73
+ . fixedSize ( horizontal : false , vertical : true )
69
74
Spacer ( )
70
75
71
76
Button {
72
77
onClose ? ( )
73
78
} label: {
74
79
Image ( systemName: " xmark " )
75
- . font ( . system( size: 20 ) )
76
- . padding ( . trailing, 10 )
80
+ . font ( . system( size: 16 ) )
77
81
. foregroundStyle ( Color . secondary)
78
82
}
79
83
}
84
+ . padding ( . trailing, 4 )
80
85
}
81
86
82
87
private var descriptionView : some View {
83
88
Text ( marker? . subtitle ?? " No description " )
84
89
. font ( Font ( BMFont . regular ( 10 ) ) )
85
- . lineLimit ( 3 )
86
90
. fixedSize ( horizontal: false , vertical: true )
91
+ . padding ( . trailing, 8 )
87
92
}
88
93
89
94
private var infoRowView : some View {
90
- HStack {
91
- HStack {
95
+ HStack ( spacing : 12 ) {
96
+ HStack ( spacing : 4 ) {
92
97
Image ( systemName: " clock " )
93
98
. font ( . system( size: 12 ) )
94
99
. foregroundColor ( . secondary)
@@ -120,15 +125,15 @@ struct MapMarkerDetailSwiftView: View {
120
125
}
121
126
122
127
private var locationInfoView : some View {
123
- HStack {
128
+ HStack ( spacing : 2 ) {
124
129
Image ( systemName: " mappin.and.ellipse " )
125
130
. font ( . system( size: 12 ) )
126
131
. foregroundColor ( . secondary)
127
132
Text ( marker? . address ?? " No Address " )
128
133
. font ( Font ( BMFont . regular ( 12 ) ) )
129
134
. foregroundColor ( . primary)
130
- . lineLimit ( 3 )
131
- . minimumScaleFactor ( 0.6 )
135
+ . lineLimit ( 1 )
136
+ . truncationMode ( . tail )
132
137
}
133
138
}
134
139
@@ -193,56 +198,6 @@ struct MapMarkerDetailSwiftView: View {
193
198
return " mappin "
194
199
}
195
200
}
196
-
197
-
198
- // MARK: - GIR Info View
199
-
200
- private var girInfoView : some View {
201
- VStack ( alignment: . leading, spacing: 2 ) {
202
- Group {
203
- let accessibleGIRs = marker? . accessibleGIRs ?? [ ]
204
- let nonAccessibleGIRs = marker? . nonAccessibleGIRs ?? [ ]
205
-
206
- Text ( " Accessible: " )
207
- . font ( Font ( BMFont . bold ( 12 ) ) )
208
-
209
- Text ( accessibleGIRs. isEmpty ? " None " : accessibleGIRs. joined ( separator: " , " ) )
210
- . font ( Font ( BMFont . light ( 12 ) ) )
211
-
212
- Text ( " Non-Accessible: " )
213
- . font ( Font ( BMFont . bold ( 12 ) ) )
214
- . padding ( . top, 4 )
215
-
216
- Text ( nonAccessibleGIRs. isEmpty ? " None " : nonAccessibleGIRs. joined ( separator: " , " ) )
217
- . font ( Font ( BMFont . light ( 12 ) ) )
218
- }
219
- . padding ( . leading, 20 )
220
- }
221
- }
222
-
223
-
224
- // MARK: - MPD Info View
225
-
226
- private var mpdInfoView : some View {
227
- VStack {
228
- ForEach ( marker? . mpdRooms ?? [ ] , id: \. roomNumber) { room in
229
- Group {
230
- VStack ( alignment: . leading, spacing: 2 ) {
231
- Text ( " Gender Type: \( room. bathroomType) " )
232
- . font ( Font ( BMFont . light ( 12 ) ) )
233
- Text ( " Floor: \( room. floorName) " )
234
- . font ( Font ( BMFont . light ( 12 ) ) )
235
- Text ( " Room Number: \( room. roomNumber) " )
236
- . font ( Font ( BMFont . light ( 12 ) ) )
237
- Text ( " Products: \( room. productType) " )
238
- . font ( Font ( BMFont . light ( 12 ) ) )
239
- }
240
- . padding ( . leading, 20 )
241
- . padding ( . bottom, 8 )
242
- }
243
- }
244
- }
245
- }
246
201
}
247
202
248
203
@@ -253,7 +208,7 @@ struct MapMarkerDetailSwiftView: View {
253
208
marker: MapMarker (
254
209
type: " Cafe " ,
255
210
location: CLLocationCoordinate2D ( latitude: 37.871684 , longitude: - 122.259934 ) ,
256
- name: " Golden Bear Cafe " ,
211
+ name: " Babette South Hall Coffee Bar " ,
257
212
description: " A retail Cal Dining location featuring a Peet Coffee & tea store, made- to-go order deli and bagels bar, smoothies, and grab-and-go items. " ,
258
213
address: " Lower Sproul Plaza " ,
259
214
onCampus: true ,
0 commit comments