mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-17 23:18:27 +02:00
fix: cherry picked NV commit to remove DSBottomSheet (MESSENGER-6854)
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
// Please see LICENSE in the repository root for full details.
|
||||
//
|
||||
|
||||
import DSBottomSheet
|
||||
import SwiftUI
|
||||
|
||||
struct LiveLocationSharingViewer: View {
|
||||
@@ -16,9 +15,7 @@ struct LiveLocationSharingViewer: View {
|
||||
@Environment(\.theme) private var theme: ThemeSwiftUI
|
||||
|
||||
@Environment(\.openURL) var openURL
|
||||
|
||||
@State private var isBottomSheetExpanded = false
|
||||
|
||||
|
||||
var bottomSheetCollapsedHeight: CGFloat = 150.0
|
||||
|
||||
// MARK: Public
|
||||
@@ -114,7 +111,19 @@ struct LiveLocationSharingViewer: View {
|
||||
}
|
||||
.accentColor(theme.colors.accent)
|
||||
.background(theme.colors.system.ignoresSafeArea())
|
||||
.bottomSheet(sheet, if: viewModel.viewState.isBottomSheetVisible)
|
||||
.sheet(isPresented: .constant(viewModel.viewState.isBottomSheetVisible)) {
|
||||
if #available(iOS 16.4, *) {
|
||||
userLocationList
|
||||
.presentationBackgroundInteraction(.enabled)
|
||||
.presentationBackground(theme.colors.background)
|
||||
.presentationDragIndicator(.visible)
|
||||
.presentationDetents([.height(bottomSheetCollapsedHeight), .large])
|
||||
.interactiveDismissDisabled()
|
||||
} else {
|
||||
userLocationList
|
||||
.interactiveDismissDisabled()
|
||||
}
|
||||
}
|
||||
.actionSheet(isPresented: $viewModel.showMapCreditsSheet) {
|
||||
MapCreditsActionSheet(
|
||||
attribution: LocationSharingAttribution(),
|
||||
@@ -135,8 +144,6 @@ struct LiveLocationSharingViewer: View {
|
||||
LiveLocationListItem(viewData: viewData, onStopSharingAction: {
|
||||
viewModel.send(viewAction: .stopSharing)
|
||||
}, onBackgroundTap: { userId in
|
||||
// Push bottom sheet down on item tap
|
||||
isBottomSheetExpanded = false
|
||||
viewModel.send(viewAction: .tapListItem(userId))
|
||||
})
|
||||
}
|
||||
@@ -147,34 +154,6 @@ struct LiveLocationSharingViewer: View {
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Bottom sheet
|
||||
|
||||
extension LiveLocationSharingViewer {
|
||||
var sheetStyle: BottomSheetStyle {
|
||||
var bottomSheetStyle = BottomSheetStyle.standard
|
||||
|
||||
bottomSheetStyle.snapRatio = 0.16
|
||||
|
||||
let backgroundColor = theme.colors.background
|
||||
|
||||
let handleStyle = BottomSheetHandleStyle(backgroundColor: backgroundColor, dividerColor: backgroundColor)
|
||||
bottomSheetStyle.handleStyle = handleStyle
|
||||
|
||||
return bottomSheetStyle
|
||||
}
|
||||
|
||||
var sheet: some BottomSheetView {
|
||||
BottomSheet(
|
||||
isExpanded: $isBottomSheetExpanded,
|
||||
minHeight: .points(bottomSheetCollapsedHeight),
|
||||
maxHeight: .available,
|
||||
style: sheetStyle
|
||||
) {
|
||||
userLocationList
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
struct LiveLocationSharingViewer_Previews: PreviewProvider {
|
||||
|
||||
Reference in New Issue
Block a user