diff --git a/Blackjack/Blackjack/Views/Sheets/ResultBannerView.swift b/Blackjack/Blackjack/Views/Sheets/ResultBannerView.swift index 33515ee..048caa4 100644 --- a/Blackjack/Blackjack/Views/Sheets/ResultBannerView.swift +++ b/Blackjack/Blackjack/Views/Sheets/ResultBannerView.swift @@ -30,8 +30,22 @@ struct ResultBannerView: View { currentBalance < minBet } - private var mainResultColor: Color { - result.mainHandResult.color + /// Overall result based on total winnings (what the player actually cares about) + private var overallResultText: String { + if result.totalWinnings > 0 { + return String(localized: "WIN!") + } else if result.totalWinnings < 0 { + return String(localized: "LOSE") + } else { + return String(localized: "PUSH") + } + } + + /// Color based on overall result + private var overallResultColor: Color { + if result.totalWinnings > 0 { return .green } + if result.totalWinnings < 0 { return .red } + return .blue } private var winningsText: String { @@ -57,10 +71,10 @@ struct ResultBannerView: View { // Content card VStack(spacing: Design.Spacing.xLarge) { - // Main result - Text(result.mainHandResult.displayText) + // Overall result based on total winnings + Text(overallResultText) .font(.system(size: titleFontSize, weight: .black, design: .rounded)) - .foregroundStyle(mainResultColor) + .foregroundStyle(overallResultColor) // Winnings Text(winningsText) @@ -184,12 +198,12 @@ struct ResultBannerView: View { .overlay( RoundedRectangle(cornerRadius: Design.CornerRadius.xxLarge) .strokeBorder( - mainResultColor.opacity(Design.Opacity.medium), + overallResultColor.opacity(Design.Opacity.medium), lineWidth: Design.LineWidth.medium ) ) ) - .shadow(color: mainResultColor.opacity(Design.Opacity.hint), radius: Design.Shadow.radiusXLarge) + .shadow(color: overallResultColor.opacity(Design.Opacity.hint), radius: Design.Shadow.radiusXLarge) .frame(maxWidth: CasinoDesign.Size.maxModalWidth) .padding(.horizontal, Design.Spacing.large) // Prevent clipping on sides .scaleEffect(showContent ? Design.Scale.normal : Design.Scale.slightShrink)