Skip to content

Commit 8b8707a

Browse files
committed
Added fixes
1 parent 3f048bb commit 8b8707a

File tree

1 file changed

+27
-72
lines changed

1 file changed

+27
-72
lines changed

berkeley-mobile/Map/MapMarkerDetailSwiftView.swift

Lines changed: 27 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,19 @@ struct MapMarkerDetailSwiftView: View {
2020
HStack {
2121
colorAccentBar
2222

23-
VStack(alignment: .leading, spacing: 8) {
23+
VStack(alignment: .leading, spacing: 4) {
2424
headerView
2525
Spacer()
2626
descriptionView
27+
.padding(.top, 2)
2728
Spacer()
2829
infoRowView
30+
.padding([.bottom, .trailing], 8)
31+
2932
}
30-
.padding(10)
33+
.padding(.vertical, 8)
34+
.padding(.horizontal, 10)
35+
Spacer()
3136
}
3237
.background(Color(.systemBackground))
3338
.clipShape(RoundedRectangle(cornerRadius: 12))
@@ -39,56 +44,56 @@ struct MapMarkerDetailSwiftView: View {
3944
}
4045

4146

42-
// MARK: - Private Views
47+
// MARK: - Private Views
4348

4449
private var colorAccentBar: some View {
4550
let markerColor: Color = {
4651
guard let marker else {
4752
return .purple
4853
}
49-
54+
5055
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)
5560
}
5661
}()
5762

5863
return Rectangle()
59-
.fill(markerColor)
60-
.frame(width: 12)
64+
.fill(markerColor)
65+
.frame(width: 12)
6166
}
6267

6368
private var headerView: some View {
6469
HStack {
65-
Text(marker?.title ?? "Unknown")
66-
.font(Font(BMFont.bold(25)))
70+
Text((marker?.title ?? "Unknown").capitalized)
71+
.font(Font(BMFont.bold(21)))
6772
.foregroundColor(.primary)
68-
.lineLimit(1)
73+
.fixedSize(horizontal: false, vertical: true)
6974
Spacer()
7075

7176
Button {
7277
onClose?()
7378
} label: {
7479
Image(systemName: "xmark")
75-
.font(.system(size: 20))
76-
.padding(.trailing, 10)
80+
.font(.system(size: 16))
7781
.foregroundStyle(Color.secondary)
7882
}
7983
}
84+
.padding(.trailing, 4)
8085
}
8186

8287
private var descriptionView: some View {
8388
Text(marker?.subtitle ?? "No description")
8489
.font(Font(BMFont.regular(10)))
85-
.lineLimit(3)
8690
.fixedSize(horizontal: false, vertical: true)
91+
.padding(.trailing, 8)
8792
}
8893

8994
private var infoRowView: some View {
90-
HStack {
91-
HStack {
95+
HStack(spacing: 12) {
96+
HStack(spacing: 4) {
9297
Image(systemName: "clock")
9398
.font(.system(size: 12))
9499
.foregroundColor(.secondary)
@@ -120,15 +125,15 @@ struct MapMarkerDetailSwiftView: View {
120125
}
121126

122127
private var locationInfoView: some View {
123-
HStack {
128+
HStack(spacing: 2) {
124129
Image(systemName: "mappin.and.ellipse")
125130
.font(.system(size: 12))
126131
.foregroundColor(.secondary)
127132
Text(marker?.address ?? "No Address")
128133
.font(Font(BMFont.regular(12)))
129134
.foregroundColor(.primary)
130-
.lineLimit(3)
131-
.minimumScaleFactor(0.6)
135+
.lineLimit(1)
136+
.truncationMode(.tail)
132137
}
133138
}
134139

@@ -193,56 +198,6 @@ struct MapMarkerDetailSwiftView: View {
193198
return "mappin"
194199
}
195200
}
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-
}
246201
}
247202

248203

@@ -253,7 +208,7 @@ struct MapMarkerDetailSwiftView: View {
253208
marker: MapMarker(
254209
type: "Cafe",
255210
location: CLLocationCoordinate2D(latitude: 37.871684, longitude: -122.259934),
256-
name: "Golden Bear Cafe",
211+
name: "Babette South Hall Coffee Bar",
257212
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.",
258213
address: "Lower Sproul Plaza",
259214
onCampus: true,

0 commit comments

Comments
 (0)