feat(wizard): add all wizard step components
- DatesStep: date range selection with duration indicator - RegionsStep: geographic region selection - RoutePreferenceStep: direct/scenic/balanced preference - RepeatCitiesStep: unique vs repeat city visits - MustStopsStep: optional must-stop locations - ReviewStep: summary and plan button Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
//
|
||||
// MustStopsStep.swift
|
||||
// SportsTime
|
||||
//
|
||||
// Step 7 of the trip wizard - add must-stop locations.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct MustStopsStep: View {
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
@Binding var mustStopLocations: [LocationInput]
|
||||
@State private var showLocationSearch = false
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: Theme.Spacing.md) {
|
||||
StepHeader(
|
||||
title: "Any must-stop locations?",
|
||||
subtitle: "Optional - add cities you want to visit"
|
||||
)
|
||||
|
||||
if !mustStopLocations.isEmpty {
|
||||
VStack(spacing: Theme.Spacing.xs) {
|
||||
ForEach(mustStopLocations, id: \.name) { location in
|
||||
HStack {
|
||||
Image(systemName: "mappin.circle.fill")
|
||||
.foregroundStyle(Theme.warmOrange)
|
||||
|
||||
Text(location.name)
|
||||
.font(.subheadline)
|
||||
.foregroundStyle(Theme.textPrimary(colorScheme))
|
||||
|
||||
Spacer()
|
||||
|
||||
Button {
|
||||
mustStopLocations.removeAll { $0.name == location.name }
|
||||
} label: {
|
||||
Image(systemName: "xmark.circle.fill")
|
||||
.foregroundStyle(Theme.textMuted(colorScheme))
|
||||
}
|
||||
}
|
||||
.padding(Theme.Spacing.sm)
|
||||
.background(Theme.cardBackgroundElevated(colorScheme))
|
||||
.clipShape(RoundedRectangle(cornerRadius: Theme.CornerRadius.medium))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
showLocationSearch = true
|
||||
} label: {
|
||||
HStack {
|
||||
Image(systemName: "plus.circle.fill")
|
||||
Text(mustStopLocations.isEmpty ? "Add a location" : "Add another")
|
||||
}
|
||||
.font(.subheadline)
|
||||
.foregroundStyle(Theme.warmOrange)
|
||||
}
|
||||
|
||||
Text("Skip this step if you don't have specific cities in mind")
|
||||
.font(.caption)
|
||||
.foregroundStyle(Theme.textMuted(colorScheme))
|
||||
}
|
||||
.padding(Theme.Spacing.lg)
|
||||
.background(Theme.cardBackground(colorScheme))
|
||||
.clipShape(RoundedRectangle(cornerRadius: Theme.CornerRadius.large))
|
||||
.overlay {
|
||||
RoundedRectangle(cornerRadius: Theme.CornerRadius.large)
|
||||
.stroke(Theme.surfaceGlow(colorScheme), lineWidth: 1)
|
||||
}
|
||||
.sheet(isPresented: $showLocationSearch) {
|
||||
LocationSearchSheet(inputType: .mustStop) { location in
|
||||
mustStopLocations.append(location)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Preview
|
||||
|
||||
#Preview {
|
||||
MustStopsStep(mustStopLocations: .constant([]))
|
||||
.padding()
|
||||
.themedBackground()
|
||||
}
|
||||
Reference in New Issue
Block a user