From 8f0f2b4b4f4b747b5d5fcc5a433f2f4b5109c940 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Mon, 13 Apr 2026 20:41:49 -0500 Subject: fix: sonarqube quality fixes --- DayByDay/MonthCard.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'DayByDay/MonthCard.swift') diff --git a/DayByDay/MonthCard.swift b/DayByDay/MonthCard.swift index f462fd4..4b1d6ae 100644 --- a/DayByDay/MonthCard.swift +++ b/DayByDay/MonthCard.swift @@ -12,6 +12,12 @@ struct MonthCard: View { var isHighlighted = false @State private var isTapped = false + private var cardScale: CGFloat { + if isTapped { return 1.12 } + if isHighlighted { return 1.04 } + return 1.0 + } + var body: some View { ZStack { RoundedRectangle(cornerRadius: 32, style: .continuous) @@ -36,7 +42,7 @@ struct MonthCard: View { } } .shadow(color: isHighlighted ? .white.opacity(0.8) : .clear, radius: 12) - .scaleEffect(isTapped ? 1.12 : (isHighlighted ? 1.04 : 1.0)) + .scaleEffect(cardScale) .contentShape(RoundedRectangle(cornerRadius: 32, style: .continuous)) .rotation3DEffect(.degrees(isTapped ? 6 : 0), axis: (x: 1, y: 0, z: 0)) .animation(.spring(response: 0.35, dampingFraction: 0.5), value: isTapped) -- cgit v1.2.3