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

Loading…
Cancel
Save