mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-29 20:56:57 +02:00
LocationSharingView: Handle map credits action sheet.
This commit is contained in:
@@ -40,6 +40,7 @@ enum LocationSharingViewAction {
|
||||
case startLiveSharing
|
||||
case shareLiveLocation(timeout: LiveLocationSharingTimeout)
|
||||
case userDidPan
|
||||
case mapCreditsDidTap
|
||||
}
|
||||
|
||||
enum LocationSharingViewModelResult {
|
||||
@@ -95,6 +96,7 @@ struct LocationSharingViewStateBindings {
|
||||
var userLocation: CLLocationCoordinate2D?
|
||||
var pinLocation: CLLocationCoordinate2D?
|
||||
var showingTimerSelector = false
|
||||
var showMapCreditsSheet = false
|
||||
}
|
||||
|
||||
enum LocationSharingAlertType {
|
||||
|
||||
@@ -86,6 +86,8 @@ class LocationSharingViewModel: LocationSharingViewModelType, LocationSharingVie
|
||||
case .userDidPan:
|
||||
state.showsUserLocation = false
|
||||
state.isPinDropSharing = true
|
||||
case .mapCreditsDidTap:
|
||||
state.bindings.showMapCreditsSheet.toggle()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@ struct LocationSharingView: View {
|
||||
|
||||
@Environment(\.theme) private var theme: ThemeSwiftUI
|
||||
|
||||
@Environment(\.openURL) var openURL
|
||||
|
||||
// MARK: Public
|
||||
|
||||
@ObservedObject var context: LocationSharingViewModel.Context
|
||||
@@ -34,7 +36,15 @@ struct LocationSharingView: View {
|
||||
ZStack(alignment: .bottom) {
|
||||
mapView
|
||||
VStack(spacing: 0) {
|
||||
MapCreditsView()
|
||||
MapCreditsView(action: {
|
||||
context.send(viewAction: .mapCreditsDidTap)
|
||||
})
|
||||
.padding(.bottom, 10.0)
|
||||
.actionSheet(isPresented: $context.showMapCreditsSheet) {
|
||||
return MapCreditsActionSheet(openURL: { url in
|
||||
openURL(url)
|
||||
}).sheet
|
||||
}
|
||||
buttonsView
|
||||
.background(theme.colors.background)
|
||||
.clipShape(RoundedCornerShape(radius: 8, corners: [.topLeft, .topRight]))
|
||||
|
||||
Reference in New Issue
Block a user