background color

feature/in-progress-card
Lucas DELANIER 11 months ago
parent c3f4ac0a68
commit ba09fafef5

@ -44,13 +44,23 @@ struct ReviewCard: View {
VStack(alignment: .center,spacing:0){
HStack(){
Spacer()
if(betDetail.bet.endBetDate < Date()){
switch betDetail.bet.status {
case .inProgress:
Text(betDetail)
.foregroundColor(.white)
.font(.system(size: 25))
.fontWeight(.bold)
case .waiting:
Text("waiting")
.foregroundColor(.white)
.font(.system(size: 25))
.fontWeight(.bold)
case .closing:
Text("bet_finished")
.foregroundColor(.white)
.font(.system(size: 25))
.fontWeight(.bold)
}
else{
case .finished:
Text(amountBetted.description)
.foregroundColor(.white)
.font(.system(size: 25))
@ -62,6 +72,11 @@ struct ReviewCard: View {
.foregroundColor(.white)
.font(.system(size: 25))
.fontWeight(.bold)
case .cancelled:
Text("cancelled")
.foregroundColor(.white)
.font(.system(size: 25))
.fontWeight(.bold)
}
Spacer()
@ -72,12 +87,19 @@ struct ReviewCard: View {
}
.frame(width: .infinity)
.padding(.all,2)
.background(
isAWin || betDetail.bet.endBetDate < Date() ?
AnyView(AllInColors.primaryGradient) :
AnyView(Color.black)
) .cornerRadius(20, corners: [.bottomLeft,.bottomRight])
.border(width: 1, edges: [.top], color: AllInColors.delimiterGrey)
.background({
switch betDetail.bet.status {
case .inProgress, .waiting, .closing:
return AllInColors.grey50Color
case .finished:
return Color.black
case .cancelled:
return Color.red
}
}())
.cornerRadius(20, corners: [.bottomLeft,.bottomRight])
.border(width: 1, edges: [.top], color: AllInColors.delimiterGrey)
}
.onTapGesture {
showDetails.toggle()

Loading…
Cancel
Save