feat(itinerary): add row views for itinerary items
Add specialized row components for the new unified itinerary system: - DayHeaderRow: Day number, date display, and add item button - GameItemRow: Prominent card with sport color bar for games - TravelItemRow: Gold-styled travel segments with drag handle - CustomItemRow: Minimal custom items with icon, title, and optional time All views follow existing Theme patterns and use SportColorBar for consistency. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
//
|
||||
// GameItemRow.swift
|
||||
// SportsTime
|
||||
//
|
||||
// Row view for displaying a game in the itinerary. Prominent card styling with sport color accent.
|
||||
// Games are not reorderable so no drag handle is shown.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct GameItemRow: View {
|
||||
let game: RichGame
|
||||
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
|
||||
var body: some View {
|
||||
HStack(spacing: Theme.Spacing.md) {
|
||||
// Sport color bar
|
||||
SportColorBar(sport: game.game.sport)
|
||||
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
// Sport badge + Matchup
|
||||
HStack(spacing: 6) {
|
||||
HStack(spacing: 3) {
|
||||
Image(systemName: game.game.sport.iconName)
|
||||
.font(.caption2)
|
||||
Text(game.game.sport.rawValue)
|
||||
.font(.caption2)
|
||||
}
|
||||
.foregroundStyle(game.game.sport.themeColor)
|
||||
|
||||
HStack(spacing: 4) {
|
||||
Text(game.awayTeam.abbreviation)
|
||||
.font(.body)
|
||||
Text("@")
|
||||
.foregroundStyle(Theme.textMuted(colorScheme))
|
||||
Text(game.homeTeam.abbreviation)
|
||||
.font(.body)
|
||||
}
|
||||
.foregroundStyle(Theme.textPrimary(colorScheme))
|
||||
}
|
||||
|
||||
// Stadium
|
||||
HStack(spacing: 4) {
|
||||
Image(systemName: "building.2")
|
||||
.font(.caption2)
|
||||
Text(game.stadium.name)
|
||||
.font(.subheadline)
|
||||
}
|
||||
.foregroundStyle(Theme.textSecondary(colorScheme))
|
||||
}
|
||||
|
||||
Spacer()
|
||||
|
||||
// Time
|
||||
Text(game.localGameTimeShort)
|
||||
.font(.subheadline)
|
||||
.foregroundStyle(Theme.warmOrange)
|
||||
}
|
||||
.padding(Theme.Spacing.md)
|
||||
.background(Theme.cardBackgroundElevated(colorScheme))
|
||||
.clipShape(RoundedRectangle(cornerRadius: Theme.CornerRadius.medium))
|
||||
.overlay {
|
||||
RoundedRectangle(cornerRadius: Theme.CornerRadius.medium)
|
||||
.strokeBorder(game.game.sport.themeColor.opacity(0.3), lineWidth: 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user