feat: show location info in schedule view
Adds stadium name and city to game rows in the schedule list. The GameRowView now has a showLocation parameter that displays a location row with mappin icon when enabled. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -92,7 +92,7 @@ struct ScheduleListView: View {
|
|||||||
ForEach(viewModel.gamesBySport, id: \.sport) { sportGroup in
|
ForEach(viewModel.gamesBySport, id: \.sport) { sportGroup in
|
||||||
Section {
|
Section {
|
||||||
ForEach(sportGroup.games) { richGame in
|
ForEach(sportGroup.games) { richGame in
|
||||||
GameRowView(game: richGame, showDate: true)
|
GameRowView(game: richGame, showDate: true, showLocation: true)
|
||||||
}
|
}
|
||||||
} header: {
|
} header: {
|
||||||
HStack(spacing: 8) {
|
HStack(spacing: 8) {
|
||||||
@@ -208,6 +208,7 @@ struct SportFilterChip: View {
|
|||||||
struct GameRowView: View {
|
struct GameRowView: View {
|
||||||
let game: RichGame
|
let game: RichGame
|
||||||
var showDate: Bool = false
|
var showDate: Bool = false
|
||||||
|
var showLocation: Bool = false
|
||||||
|
|
||||||
private var isToday: Bool {
|
private var isToday: Bool {
|
||||||
Calendar.current.isDateInToday(game.game.dateTime)
|
Calendar.current.isDateInToday(game.game.dateTime)
|
||||||
@@ -262,6 +263,18 @@ struct GameRowView: View {
|
|||||||
}
|
}
|
||||||
.font(.caption)
|
.font(.caption)
|
||||||
.foregroundStyle(.secondary)
|
.foregroundStyle(.secondary)
|
||||||
|
|
||||||
|
// Location info (when grouped by game)
|
||||||
|
if showLocation {
|
||||||
|
HStack(spacing: 4) {
|
||||||
|
Image(systemName: "mappin.circle.fill")
|
||||||
|
.font(.caption2)
|
||||||
|
.foregroundStyle(.tertiary)
|
||||||
|
Text(game.stadium.city)
|
||||||
|
.font(.caption)
|
||||||
|
.foregroundStyle(.secondary)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.padding(.vertical, 4)
|
.padding(.vertical, 4)
|
||||||
.listRowBackground(isToday ? Color.orange.opacity(0.1) : nil)
|
.listRowBackground(isToday ? Color.orange.opacity(0.1) : nil)
|
||||||
|
|||||||
Reference in New Issue
Block a user