|
|
|
@ -19,6 +19,7 @@ struct MatchSummaryView: View { |
|
|
|
let color: Color |
|
|
|
let color: Color |
|
|
|
let width: CGFloat |
|
|
|
let width: CGFloat |
|
|
|
let updatedField: Int? |
|
|
|
let updatedField: Int? |
|
|
|
|
|
|
|
let estimatedStartDate: Match.CourtIndexAndDate? |
|
|
|
|
|
|
|
|
|
|
|
init(match: Match, matchViewStyle: MatchViewStyle, title: String? = nil, updatedField: Int? = nil) { |
|
|
|
init(match: Match, matchViewStyle: MatchViewStyle, title: String? = nil, updatedField: Int? = nil) { |
|
|
|
self.match = match |
|
|
|
self.match = match |
|
|
|
@ -44,6 +45,8 @@ struct MatchSummaryView: View { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
self.courtName = nil |
|
|
|
self.courtName = nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.estimatedStartDate = match.estimatedStartDate() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var body: some View { |
|
|
|
var body: some View { |
|
|
|
@ -67,11 +70,13 @@ struct MatchSummaryView: View { |
|
|
|
} else if let first = match.availableCourts().first { |
|
|
|
} else if let first = match.availableCourts().first { |
|
|
|
Text("possible") |
|
|
|
Text("possible") |
|
|
|
Text(match.courtName(for: first)) |
|
|
|
Text(match.courtName(for: first)) |
|
|
|
} else if let estimatedStartDate = match.estimatedStartDate() { |
|
|
|
} else if let estimatedStartDate { |
|
|
|
Text(match.courtName(for: estimatedStartDate.0) + " possible") |
|
|
|
Text(match.courtName(for: estimatedStartDate.0) + " possible") |
|
|
|
Text("dans ~ " + estimatedStartDate.1.timeElapsedString()) |
|
|
|
Text("dans ~ " + estimatedStartDate.1.timeElapsedString()) |
|
|
|
|
|
|
|
} else if let courtName { |
|
|
|
|
|
|
|
Text(courtName) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
Text("aucun terrain disponible") |
|
|
|
Text("") |
|
|
|
} |
|
|
|
} |
|
|
|
} else if let courtName { |
|
|
|
} else if let courtName { |
|
|
|
Text(courtName) |
|
|
|
Text(courtName) |
|
|
|
@ -111,7 +116,7 @@ struct MatchSummaryView: View { |
|
|
|
.foregroundStyle(.secondary) |
|
|
|
.foregroundStyle(.secondary) |
|
|
|
} |
|
|
|
} |
|
|
|
Spacer() |
|
|
|
Spacer() |
|
|
|
MatchDateView(match: match, showPrefix: matchViewStyle == .tournamentResultStyle, updatedField: updatedField) |
|
|
|
MatchDateView(match: match, showPrefix: matchViewStyle == .tournamentResultStyle, updatedField: updatedField ?? estimatedStartDate?.0) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|