aaffa3771c
Two-target restructure: shared sources (models, services, settings, extensions, team logos) move into Shared/, consumed by both the existing macOS menu bar app and a new iOS app. MainService no longer imports AppKit — platform code attaches via a MainServiceObserver protocol (MacObserverAdapter wires back to MenuManager / StatusItemManager / NotificationManager). iPhone app is a single SwiftUI page mirroring the macOS menu (playoff round + yesterday/today/tomorrow), with a gear-icon settings sheet (display option + IndieAbout for license/changelog). Persistent JSON snapshot in Application Support paints last-known data on cold launch; "Updated …" header escalates secondary → orange (>5min) → red (>30min) so staleness is visually unmistakable. Foreground polling, scenePhase refresh, and pull-to-refresh; no notifications on iOS in v1.
53 lines
1.7 KiB
Swift
53 lines
1.7 KiB
Swift
//
|
|
// GameDaySection.swift
|
|
// IceGlass-iOS
|
|
//
|
|
// Copyright 2026 Rouslan Zenetl. All Rights Reserved.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct GameDaySection: View {
|
|
let gameDay: Scoreboard.GameDay
|
|
|
|
var body: some View {
|
|
VStack(alignment: .leading, spacing: 8) {
|
|
HStack(alignment: .firstTextBaseline) {
|
|
Text(headerText)
|
|
.font(.caption)
|
|
.fontWeight(.bold)
|
|
.foregroundStyle(.secondary)
|
|
Spacer()
|
|
}
|
|
|
|
if gameDay.games.isEmpty {
|
|
Text("No games scheduled")
|
|
.font(.subheadline)
|
|
.italic()
|
|
.foregroundStyle(.tertiary)
|
|
.padding(.horizontal, 14)
|
|
.padding(.vertical, 12)
|
|
.frame(maxWidth: .infinity, alignment: .leading)
|
|
.background(Color(uiColor: .secondarySystemGroupedBackground))
|
|
.clipShape(RoundedRectangle(cornerRadius: 12))
|
|
} else {
|
|
VStack(spacing: 0) {
|
|
ForEach(Array(gameDay.games.enumerated()), id: \.element.id) { idx, game in
|
|
GameRow(game: game)
|
|
if idx < gameDay.games.count - 1 {
|
|
Divider()
|
|
}
|
|
}
|
|
}
|
|
.background(Color(uiColor: .secondarySystemGroupedBackground))
|
|
.clipShape(RoundedRectangle(cornerRadius: 12))
|
|
}
|
|
}
|
|
}
|
|
|
|
private var headerText: String {
|
|
let label = Date.fullDateLabel(for: gameDay.date)
|
|
return "\(label) (\(gameDay.games.count))"
|
|
}
|
|
}
|