Add team logos and monospaced tricodes to iPhone game/series rows
New TeamLogo view loads bundled TeamLogos/{abbrev}.png with a UIImage
cache so scrolling doesn't repeatedly re-decode. GameRow and SeriesRow
now render [logo] TRI @ [logo] TRI with tricodes in a monospaced font
so columns line up regardless of which letters are present. SF Symbol
fallback when an abbrev has no bundled logo (e.g. "TBD" for unfilled
playoff slots).
This commit is contained in:
@@ -12,7 +12,7 @@ struct GameRow: View {
|
||||
|
||||
var body: some View {
|
||||
Button(action: open) {
|
||||
HStack(spacing: 12) {
|
||||
HStack(spacing: 10) {
|
||||
if game.gameType == 2 {
|
||||
Text("#\(game.seasonGameNumber)")
|
||||
.font(.caption2.monospacedDigit())
|
||||
@@ -20,12 +20,9 @@ struct GameRow: View {
|
||||
.frame(width: 44, alignment: .leading)
|
||||
}
|
||||
|
||||
Text("\(game.awayTeam.abbrev) @ \(game.homeTeam.abbrev)")
|
||||
.font(.body)
|
||||
.fontWeight(.medium)
|
||||
.foregroundStyle(.primary)
|
||||
matchupBlock
|
||||
|
||||
Spacer()
|
||||
Spacer(minLength: 8)
|
||||
|
||||
rightContent
|
||||
}
|
||||
@@ -36,6 +33,24 @@ struct GameRow: View {
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
|
||||
private var matchupBlock: some View {
|
||||
HStack(spacing: 6) {
|
||||
TeamLogo(abbrev: game.awayTeam.abbrev)
|
||||
Text(game.awayTeam.abbrev)
|
||||
.font(.body.monospaced())
|
||||
.fontWeight(.medium)
|
||||
.foregroundStyle(.primary)
|
||||
Text("@")
|
||||
.font(.subheadline)
|
||||
.foregroundStyle(.tertiary)
|
||||
TeamLogo(abbrev: game.homeTeam.abbrev)
|
||||
Text(game.homeTeam.abbrev)
|
||||
.font(.body.monospaced())
|
||||
.fontWeight(.medium)
|
||||
.foregroundStyle(.primary)
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private var rightContent: some View {
|
||||
let state = game.parsedGameState
|
||||
|
||||
Reference in New Issue
Block a user