prevent replies to LLS timeline items, and live location sharing in threads

This commit is contained in:
Mauro Romito
2026-05-12 14:42:12 +02:00
committed by Mauro
parent 212ac17d0b
commit 07fc022a65
12 changed files with 73 additions and 29 deletions
@@ -11,7 +11,14 @@ import SwiftUI
struct LocationPickerSheet: View {
@Bindable var context: LocationSharingScreenViewModel.Context
@State private var height: CGFloat = .zero
/// Fixes an iOS 26 sheet issue
/// if the content doesn't meet a certain size
/// additional insets are added.
private var additionalHeight: CGFloat {
context.viewState.interactionMode.shouldShowLiveLocationOption ? 0 : 28
}
var body: some View {
VStack(spacing: 0) {
Text(L10n.screenSharingLocationOptionSheetTitle)
@@ -34,12 +41,14 @@ struct LocationPickerSheet: View {
}
}
Button {
context.send(viewAction: .startLiveLocation)
} label: {
LocationPickerLabel(text: L10n.actionShareLiveLocation,
icon: \.locationPinSolid,
iconColor: .compound.iconAccentPrimary)
if context.viewState.interactionMode.shouldShowLiveLocationOption {
Button {
context.send(viewAction: .startLiveLocation)
} label: {
LocationPickerLabel(text: L10n.actionShareLiveLocation,
icon: \.locationPinSolid,
iconColor: .compound.iconAccentPrimary)
}
}
}
.readHeight($height)
@@ -47,7 +56,7 @@ struct LocationPickerSheet: View {
.presentationBackground(.compound.bgCanvasDefault)
.presentationBackgroundInteraction(.enabled)
.presentationDragIndicator(.hidden)
.presentationDetents([.height(height)])
.presentationDetents([.height(height + additionalHeight)])
}
}