feat: enforce custom Theme colors app-wide, add debug sample trips and poll
Replace all system colors (.secondary, Color(.secondarySystemBackground), etc.) with Theme.textPrimary/textSecondary/textMuted/cardBackground/ surfaceGlow across 13 views. Remove PostHog debug logging. Add debug settings for sample trips and hardcoded group poll preview. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import SwiftUI
|
||||
|
||||
struct GamesHistoryRow: View {
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
let visit: StadiumVisit
|
||||
let stadium: Stadium?
|
||||
|
||||
@@ -20,16 +21,17 @@ struct GamesHistoryRow: View {
|
||||
// Date
|
||||
Text(visit.visitDate.formatted(date: .abbreviated, time: .omitted))
|
||||
.font(.subheadline.bold())
|
||||
.foregroundStyle(Theme.textPrimary(colorScheme))
|
||||
|
||||
// Teams (if game)
|
||||
if let matchup = visit.matchupDescription {
|
||||
Text(matchup)
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
.foregroundStyle(Theme.textSecondary(colorScheme))
|
||||
} else {
|
||||
Text(visit.stadiumNameAtVisit)
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
.foregroundStyle(Theme.textSecondary(colorScheme))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,11 +40,11 @@ struct GamesHistoryRow: View {
|
||||
// Chevron
|
||||
Image(systemName: "chevron.right")
|
||||
.font(.caption)
|
||||
.foregroundStyle(.tertiary)
|
||||
.foregroundStyle(Theme.textMuted(colorScheme))
|
||||
.accessibilityHidden(true)
|
||||
}
|
||||
.padding()
|
||||
.background(Color(.systemBackground))
|
||||
.background(Theme.cardBackground(colorScheme))
|
||||
.clipShape(RoundedRectangle(cornerRadius: 10))
|
||||
.accessibilityElement(children: .combine)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import SwiftUI
|
||||
|
||||
struct VisitListCard: View {
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
let visit: StadiumVisit
|
||||
@State private var isExpanded = false
|
||||
|
||||
@@ -17,9 +18,10 @@ struct VisitListCard: View {
|
||||
VStack(alignment: .leading, spacing: 2) {
|
||||
Text(visit.visitDate.formatted(date: .abbreviated, time: .omitted))
|
||||
.font(.subheadline.bold())
|
||||
.foregroundStyle(Theme.textPrimary(colorScheme))
|
||||
Text(visit.visitType.displayName)
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
.foregroundStyle(Theme.textSecondary(colorScheme))
|
||||
}
|
||||
|
||||
Spacer()
|
||||
@@ -28,14 +30,14 @@ struct VisitListCard: View {
|
||||
if let matchup = visit.matchupDescription {
|
||||
Text(matchup)
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
.foregroundStyle(Theme.textSecondary(colorScheme))
|
||||
.lineLimit(1)
|
||||
}
|
||||
|
||||
// Chevron
|
||||
Image(systemName: "chevron.right")
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
.foregroundStyle(Theme.textMuted(colorScheme))
|
||||
.rotationEffect(.degrees(isExpanded ? 90 : 0))
|
||||
.accessibilityLabel(isExpanded ? "Collapse details" : "Expand details")
|
||||
}
|
||||
@@ -79,12 +81,13 @@ struct VisitListCard: View {
|
||||
.transition(.opacity.combined(with: .move(edge: .top)))
|
||||
}
|
||||
}
|
||||
.background(Color(.systemBackground))
|
||||
.background(Theme.cardBackground(colorScheme))
|
||||
.clipShape(RoundedRectangle(cornerRadius: 12))
|
||||
}
|
||||
}
|
||||
|
||||
private struct GameInfoRow: View {
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
let matchup: String
|
||||
let score: String?
|
||||
|
||||
@@ -93,11 +96,12 @@ private struct GameInfoRow: View {
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
Text(matchup)
|
||||
.font(.subheadline.bold())
|
||||
.foregroundStyle(Theme.textPrimary(colorScheme))
|
||||
|
||||
if let score {
|
||||
Text("Final: \(score)")
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
.foregroundStyle(Theme.textSecondary(colorScheme))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,6 +111,7 @@ private struct GameInfoRow: View {
|
||||
}
|
||||
|
||||
private struct InfoRow: View {
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
let icon: String
|
||||
let label: String
|
||||
let value: String
|
||||
@@ -115,16 +120,17 @@ private struct InfoRow: View {
|
||||
HStack(spacing: 8) {
|
||||
Image(systemName: icon)
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
.foregroundStyle(Theme.textMuted(colorScheme))
|
||||
.frame(width: 16)
|
||||
.accessibilityHidden(true)
|
||||
|
||||
Text(label)
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
.foregroundStyle(Theme.textSecondary(colorScheme))
|
||||
|
||||
Text(value)
|
||||
.font(.caption)
|
||||
.foregroundStyle(Theme.textPrimary(colorScheme))
|
||||
.lineLimit(2)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user