Signed-off-by: Matt Bruce <matt.bruce1@toyota.com>
This commit is contained in:
parent
ace6303a62
commit
8402432363
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user