@@ -37,7 +37,7 @@ struct MapView: View {
3737 selectedQuest: $viewModel. selectedQuest,
3838 shouldShowPolyline: $shouldShowPolyline,
3939
40- isPresented: $showPopover , contextualInfo: { contextualInfo in
40+ isPresented: $isPresented , contextualInfo: { contextualInfo in
4141 print ( contextualInfo)
4242 selectedDetent = . fraction( 0.8 )
4343 self . setContextualInfo ( contextualinfo: contextualInfo)
@@ -108,40 +108,8 @@ struct MapView: View {
108108 EmptyView ( )
109109 }
110110 }
111- // ToolbarItem(placement: .navigationBarTrailing) {
112- // HStack {
113- // NavigationLink(destination: QuestsListUIView()) {
114- // Image(systemName: "list.bullet")
115- // }
116- // NavigationLink(destination: MeasureSidewalkView()) {
117- // Image(systemName: "camera")
118- // }
119- // }
120- // }
121111 }
122112 . toolbarBackground ( . visible, for: . navigationBar)
123-
124- . popover ( isPresented: $showPopover) {
125- VStack {
126- Button ( " Hide Quest " ) {
127- viewModel. hideQuest ( elementId: viewModel. selectedQuest!. parent!. displayUnit. id)
128- showPopover = false
129- shouldShowPolyline = false
130- }
131-
132- Button ( " Answer Quest " ) {
133- showPopover = false
134- isPresented = true
135- }
136- . padding ( )
137- }
138- . padding ( [ . top] , 50 )
139- . frame ( maxHeight: 50 )
140- . onAppear {
141- shouldShowPolyline = true
142- }
143- . presentationDetents ( [ . fraction( 0.2 ) ] )
144- }
145113 . onChange ( of: showPopover) { newValue in
146114 if !newValue {
147115 shouldShowPolyline = false
@@ -182,6 +150,9 @@ struct MapView: View {
182150 isSyncing = false
183151 print ( " synced " )
184152 showAlert = true
153+ case . hideElement( let elementId) :
154+ shouldShowPolyline = false
155+ viewModel. hideQuest ( elementId: elementId)
185156 }
186157 }
187158 . onReceive ( QuestsPublisher . shared. refreshQuest, perform: { _ in
@@ -218,6 +189,7 @@ public enum SheetDismissalScenario {
218189 case submitted( String )
219190 case syncing
220191 case synced
192+ case hideElement( String )
221193}
222194
223195//TODO: Move to a new file
0 commit comments