Files
Sportstime/SportsTime/Features/Trip/Views/ItineraryRows/DayHeaderRow.swift
Trey t 7700104597 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>
2026-01-17 21:28:11 -06:00

55 lines
1.4 KiB
Swift

//
// DayHeaderRow.swift
// SportsTime
//
// Header row for a day in the itinerary with day number, date, and add button.
//
import SwiftUI
struct DayHeaderRow: View {
let dayNumber: Int
let date: Date
let onAddTapped: () -> Void
@Environment(\.colorScheme) private var colorScheme
private var formattedDate: String {
date.formatted(.dateTime.weekday(.wide).month().day())
}
var body: some View {
HStack {
VStack(alignment: .leading, spacing: 2) {
Text("Day \(dayNumber)")
.font(.title3)
.fontWeight(.semibold)
.foregroundStyle(Theme.textPrimary(colorScheme))
Text(formattedDate)
.font(.subheadline)
.foregroundStyle(Theme.textSecondary(colorScheme))
}
Spacer()
Button(action: onAddTapped) {
Image(systemName: "plus.circle.fill")
.font(.title2)
.foregroundStyle(Theme.warmOrange)
}
}
.padding(.vertical, Theme.Spacing.sm)
.padding(.horizontal, Theme.Spacing.md)
}
}
#Preview {
VStack {
DayHeaderRow(dayNumber: 1, date: Date(), onAddTapped: {})
DayHeaderRow(dayNumber: 2, date: Date().addingTimeInterval(86400), onAddTapped: {})
}
.padding()
.background(Color.gray.opacity(0.1))
}