fix: move paywall sheet to stable scope and fix map button positions

Move .sheet(isPresented: $showPaywall) from subscription section to
top-level body so StoreManager state changes don't dismiss the sheet.
Reposition heart (16pt top/trailing) and map (16pt bottom/trailing,
above gradient) buttons on trip detail map.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-02-20 14:05:37 -06:00
parent d1429071f6
commit c52b70089e
2 changed files with 23 additions and 24 deletions

View File

@@ -76,6 +76,9 @@ struct SettingsView: View {
} message: {
Text("This will reset all settings to their default values.")
}
.sheet(isPresented: $showPaywall) {
PaywallView(source: "settings")
}
.sheet(isPresented: $showOnboardingPaywall) {
OnboardingPaywallView(isPresented: $showOnboardingPaywall)
}
@@ -814,9 +817,6 @@ struct SettingsView: View {
Text("Subscription")
}
.listRowBackground(Theme.cardBackground(colorScheme))
.sheet(isPresented: $showPaywall) {
PaywallView(source: "settings")
}
}
// MARK: - Helpers

View File

@@ -408,11 +408,18 @@ struct TripDetailView: View {
}
.accessibilityIdentifier("tripDetail.favoriteButton")
.accessibilityLabel(isSaved ? "Remove from favorites" : "Save to favorites")
.padding(.top, 12)
.padding(.trailing, 12)
.padding(.top, 16)
.padding(.trailing, 16)
}
.overlay(alignment: .bottomTrailing) {
// Open in Apple Maps button
// Gradient overlay at bottom
LinearGradient(
colors: [.clear, Theme.cardBackground(colorScheme).opacity(0.8), Theme.cardBackground(colorScheme)],
startPoint: .top,
endPoint: .bottom
)
.frame(height: 80)
// Open in Apple Maps button above gradient in ZStack
Button {
openInAppleMaps()
} label: {
@@ -424,19 +431,11 @@ struct TripDetailView: View {
.clipShape(Circle())
.shadow(color: .black.opacity(0.3), radius: 4, y: 2)
}
.padding(.bottom, 90) // Above the gradient
.padding(.trailing, 12)
.accessibilityLabel("Open in Apple Maps")
.accessibilityHint("Opens this trip route in Apple Maps")
}
// Gradient overlay at bottom
LinearGradient(
colors: [.clear, Theme.cardBackground(colorScheme).opacity(0.8), Theme.cardBackground(colorScheme)],
startPoint: .top,
endPoint: .bottom
)
.frame(height: 80)
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .bottomTrailing)
.padding(.bottom, 16)
.padding(.trailing, 16)
// Loading indicator
if isLoadingRoutes {