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:
@@ -76,6 +76,9 @@ struct SettingsView: View {
|
|||||||
} message: {
|
} message: {
|
||||||
Text("This will reset all settings to their default values.")
|
Text("This will reset all settings to their default values.")
|
||||||
}
|
}
|
||||||
|
.sheet(isPresented: $showPaywall) {
|
||||||
|
PaywallView(source: "settings")
|
||||||
|
}
|
||||||
.sheet(isPresented: $showOnboardingPaywall) {
|
.sheet(isPresented: $showOnboardingPaywall) {
|
||||||
OnboardingPaywallView(isPresented: $showOnboardingPaywall)
|
OnboardingPaywallView(isPresented: $showOnboardingPaywall)
|
||||||
}
|
}
|
||||||
@@ -814,9 +817,6 @@ struct SettingsView: View {
|
|||||||
Text("Subscription")
|
Text("Subscription")
|
||||||
}
|
}
|
||||||
.listRowBackground(Theme.cardBackground(colorScheme))
|
.listRowBackground(Theme.cardBackground(colorScheme))
|
||||||
.sheet(isPresented: $showPaywall) {
|
|
||||||
PaywallView(source: "settings")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Helpers
|
// MARK: - Helpers
|
||||||
|
|||||||
@@ -408,28 +408,9 @@ struct TripDetailView: View {
|
|||||||
}
|
}
|
||||||
.accessibilityIdentifier("tripDetail.favoriteButton")
|
.accessibilityIdentifier("tripDetail.favoriteButton")
|
||||||
.accessibilityLabel(isSaved ? "Remove from favorites" : "Save to favorites")
|
.accessibilityLabel(isSaved ? "Remove from favorites" : "Save to favorites")
|
||||||
.padding(.top, 12)
|
.padding(.top, 16)
|
||||||
.padding(.trailing, 12)
|
.padding(.trailing, 16)
|
||||||
}
|
}
|
||||||
.overlay(alignment: .bottomTrailing) {
|
|
||||||
// Open in Apple Maps button
|
|
||||||
Button {
|
|
||||||
openInAppleMaps()
|
|
||||||
} label: {
|
|
||||||
Image(systemName: "map.fill")
|
|
||||||
.font(.title3)
|
|
||||||
.foregroundStyle(.white)
|
|
||||||
.padding(12)
|
|
||||||
.background(Theme.warmOrange)
|
|
||||||
.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
|
// Gradient overlay at bottom
|
||||||
LinearGradient(
|
LinearGradient(
|
||||||
colors: [.clear, Theme.cardBackground(colorScheme).opacity(0.8), Theme.cardBackground(colorScheme)],
|
colors: [.clear, Theme.cardBackground(colorScheme).opacity(0.8), Theme.cardBackground(colorScheme)],
|
||||||
@@ -438,6 +419,24 @@ struct TripDetailView: View {
|
|||||||
)
|
)
|
||||||
.frame(height: 80)
|
.frame(height: 80)
|
||||||
|
|
||||||
|
// Open in Apple Maps button — above gradient in ZStack
|
||||||
|
Button {
|
||||||
|
openInAppleMaps()
|
||||||
|
} label: {
|
||||||
|
Image(systemName: "map.fill")
|
||||||
|
.font(.title3)
|
||||||
|
.foregroundStyle(.white)
|
||||||
|
.padding(12)
|
||||||
|
.background(Theme.warmOrange)
|
||||||
|
.clipShape(Circle())
|
||||||
|
.shadow(color: .black.opacity(0.3), radius: 4, y: 2)
|
||||||
|
}
|
||||||
|
.accessibilityLabel("Open in Apple Maps")
|
||||||
|
.accessibilityHint("Opens this trip route in Apple Maps")
|
||||||
|
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .bottomTrailing)
|
||||||
|
.padding(.bottom, 16)
|
||||||
|
.padding(.trailing, 16)
|
||||||
|
|
||||||
// Loading indicator
|
// Loading indicator
|
||||||
if isLoadingRoutes {
|
if isLoadingRoutes {
|
||||||
LoadingSpinner(size: .medium)
|
LoadingSpinner(size: .medium)
|
||||||
|
|||||||
Reference in New Issue
Block a user