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,17 +12,9 @@ struct SeriesRow: View {
|
||||
|
||||
var body: some View {
|
||||
Button(action: open) {
|
||||
HStack(alignment: .center, spacing: 12) {
|
||||
VStack(alignment: .leading, spacing: 2) {
|
||||
Text(matchupText)
|
||||
.font(.body)
|
||||
.fontWeight(.medium)
|
||||
.foregroundStyle(.primary)
|
||||
Text(scoreText)
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
Spacer()
|
||||
HStack(alignment: .center, spacing: 10) {
|
||||
matchupBlock
|
||||
Spacer(minLength: 8)
|
||||
VStack(alignment: .trailing, spacing: 2) {
|
||||
Text(statusText)
|
||||
.font(.caption)
|
||||
@@ -42,10 +34,29 @@ struct SeriesRow: View {
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
|
||||
private var matchupText: String {
|
||||
let top = item.series.topSeedTeam?.abbrev ?? "TBD"
|
||||
private var matchupBlock: some View {
|
||||
let bottom = item.series.bottomSeedTeam?.abbrev ?? "TBD"
|
||||
return "\(bottom) @ \(top)"
|
||||
let top = item.series.topSeedTeam?.abbrev ?? "TBD"
|
||||
return VStack(alignment: .leading, spacing: 4) {
|
||||
HStack(spacing: 6) {
|
||||
TeamLogo(abbrev: bottom)
|
||||
Text(bottom)
|
||||
.font(.body.monospaced())
|
||||
.fontWeight(.medium)
|
||||
.foregroundStyle(.primary)
|
||||
Text("@")
|
||||
.font(.subheadline)
|
||||
.foregroundStyle(.tertiary)
|
||||
TeamLogo(abbrev: top)
|
||||
Text(top)
|
||||
.font(.body.monospaced())
|
||||
.fontWeight(.medium)
|
||||
.foregroundStyle(.primary)
|
||||
}
|
||||
Text(scoreText)
|
||||
.font(.caption.monospacedDigit())
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
}
|
||||
|
||||
private var scoreText: String {
|
||||
|
||||
Reference in New Issue
Block a user