Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Commit

Permalink
Feature/map annotations show details (#459)
Browse files Browse the repository at this point in the history
* Show details of cafeteria/study room if the annotation is tapped

* Fixing dark mode bug when switching between cafeterias and study rooms
  • Loading branch information
14slash12 authored Jul 7, 2022
1 parent 1a4c760 commit 4079fff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Campus-iOS/MapComponent/View/MapContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ class MapContentCoordinator: NSObject, MKMapViewDelegate {
for i in 0...(control.vm.cafeterias.count - 1) {
if title == control.vm.cafeterias[i].title {
control.vm.selectedAnnotationIndex = i
// Making the selected annotation (i.e. cafeteria) the selected cafeteria -> shows the MealPlanView inside the PanelContentView like tapping on a cafeteria in the PanelContentCafeteriasListView
control.vm.selectedCafeteria = control.vm.cafeterias[i]
control.vm.panelPosition = "pushMid"
}
}
Expand All @@ -211,6 +213,8 @@ class MapContentCoordinator: NSObject, MKMapViewDelegate {
for i in 0...(groups.count - 1) {
if title == groups[i].name {
control.vm.selectedAnnotationIndex = i
// Making the selected annotation (i.e. study group) the selected study group -> shows the StudyRoomGroupView with inside the PanelContentView like tapping on a study group in the PanelContentStudyRoomGroupsListView
control.vm.selectedStudyGroup = groups[i]
control.vm.panelPosition = "pushMid"
}
}
Expand Down
2 changes: 0 additions & 2 deletions Campus-iOS/MapComponent/View/PanelContentListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ struct PanelContentListView: View {
}
case .loading, .na:
ZStack {
Color.white
VStack {
LoadingView(text: "Fetching Canteens", position: .middletop)
Spacer().frame(width: screenWidth, height: screenHeight * (1 - 8.2/10))
Expand Down Expand Up @@ -98,7 +97,6 @@ struct PanelContentListView: View {
}
case .loading, .na:
ZStack {
Color.white
VStack {
LoadingView(text: "Fetching Study Rooms", position: .middletop)
Spacer().frame(width: screenWidth, height: screenHeight * (1 - 8.2/10))
Expand Down

0 comments on commit 4079fff

Please sign in to comment.