From 9dd8751cc98e832fe74390a0e7578a784a62984d Mon Sep 17 00:00:00 2001 From: ludelanier Date: Mon, 10 Jun 2024 14:00:29 +0200 Subject: [PATCH] fix winning and loosing status --- .../AllIn/Components/ReviewCard.swift | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/Sources/AllInApp/AllIn/Components/ReviewCard.swift b/Sources/AllInApp/AllIn/Components/ReviewCard.swift index cc06604..c04b9d3 100644 --- a/Sources/AllInApp/AllIn/Components/ReviewCard.swift +++ b/Sources/AllInApp/AllIn/Components/ReviewCard.swift @@ -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 { - switch bet.status { - case .inProgress, .waiting, .closing: - return AllInColors.grey50Color - case .finished: - return Color.black - case .cancelled: - return Color.red + private func backgroundColor() -> some View { + Group { + if bet.status == .finished && isWin { + AllInColors.primaryGradient + } else { + switch bet.status { + case .inProgress, .waiting, .closing: + AllInColors.grey50Color + case .finished: + Color.black + case .cancelled: + Color.red + } + } + } } - } } -- 2.36.3