Files
Sportstime/SportsTime/Features/Progress/Views/Components/GamesHistoryRow.swift
Trey t d63d311cab feat: add WCAG AA accessibility app-wide, fix CloudKit container config, remove debug logs
- Add VoiceOver labels, hints, and element grouping across all 60+ views
- Add Reduce Motion support (Theme.Animation.prefersReducedMotion) to all animations
- Replace fixed font sizes with semantic Dynamic Type styles
- Hide decorative elements from VoiceOver with .accessibilityHidden(true)
- Add .minimumHitTarget() modifier ensuring 44pt touch targets
- Add AccessibilityAnnouncer utility for VoiceOver announcements
- Improve color contrast values in Theme.swift for WCAG AA compliance
- Extract CloudKitContainerConfig for explicit container identity
- Remove PostHog debug console log from AnalyticsManager

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 09:27:23 -06:00

70 lines
2.0 KiB
Swift

import SwiftUI
struct GamesHistoryRow: View {
let visit: StadiumVisit
let stadium: Stadium?
var body: some View {
HStack(spacing: 12) {
// Sport icon
if let stadium {
Image(systemName: sportIcon(for: stadium.sport))
.font(.title3)
.foregroundStyle(stadium.sport.themeColor)
.frame(width: 32)
.accessibilityHidden(true)
}
// Visit info
VStack(alignment: .leading, spacing: 4) {
// Date
Text(visit.visitDate.formatted(date: .abbreviated, time: .omitted))
.font(.subheadline.bold())
// Teams (if game)
if let matchup = visit.matchupDescription {
Text(matchup)
.font(.caption)
.foregroundStyle(.secondary)
} else {
Text(visit.stadiumNameAtVisit)
.font(.caption)
.foregroundStyle(.secondary)
}
}
Spacer()
// Chevron
Image(systemName: "chevron.right")
.font(.caption)
.foregroundStyle(.tertiary)
.accessibilityHidden(true)
}
.padding()
.background(Color(.systemBackground))
.clipShape(RoundedRectangle(cornerRadius: 10))
.accessibilityElement(children: .combine)
}
private func sportIcon(for sport: Sport) -> String {
switch sport {
case .mlb: return "baseball"
case .nba: return "basketball"
case .nhl: return "hockey.puck"
case .nfl: return "football"
case .mls: return "soccerball"
case .wnba: return "basketball"
case .nwsl: return "soccerball"
}
}
}
#Preview {
VStack {
Text("GamesHistoryRow Preview")
}
.padding()
.background(Color(.systemGroupedBackground))
}