Pass selected sport from quick start to trip creation
- Add initialSport parameter to TripCreationView - Set selected sport when quick start button is tapped - Auto-select that sport in trip planning view on appear - Clear selection when sheet is dismissed 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,13 @@ struct TripCreationView: View {
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
|
||||
let initialSport: Sport?
|
||||
|
||||
@State private var viewModel = TripCreationViewModel()
|
||||
|
||||
init(initialSport: Sport? = nil) {
|
||||
self.initialSport = initialSport
|
||||
}
|
||||
@State private var showGamePicker = false
|
||||
@State private var showCityInput = false
|
||||
@State private var cityInputType: CityInputType = .mustStop
|
||||
@@ -161,6 +167,11 @@ struct TripCreationView: View {
|
||||
.task {
|
||||
await viewModel.loadScheduleData()
|
||||
}
|
||||
.onAppear {
|
||||
if let sport = initialSport {
|
||||
viewModel.selectedSports = [sport]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user