fix winning and loosing status (#38)

Co-authored-by: ludelanier <lucas.delanier@etu.uca.fr>
Reviewed-on: #38
fix/multiples-fix
Lucas DELANIER 10 months ago
parent b878759b3d
commit f4e3edbf4a

@ -82,9 +82,8 @@ struct ReviewCard: View {
.frame(width: .infinity)
.padding(.all,2)
.background(backgroundColor())
.cornerRadius(20, corners: [.bottomLeft,.bottomRight])
.border(width: 1, edges: [.top], color: AllInColors.delimiterGrey)
}
.onTapGesture {
showDetails.toggle()
@ -93,14 +92,20 @@ struct ReviewCard: View {
}
}
private func backgroundColor() -> Color {
private func backgroundColor() -> some View {
Group {
if bet.status == .finished && isWin {
AllInColors.primaryGradient
} else {
switch bet.status {
case .inProgress, .waiting, .closing:
return AllInColors.grey50Color
AllInColors.grey50Color
case .finished:
return Color.black
Color.black
case .cancelled:
return Color.red
Color.red
}
}
}
}
}

Loading…
Cancel
Save