From 5a46ee61be013dd690c4058b076e3b7139e18cfd Mon Sep 17 00:00:00 2001 From: Sam Symons Date: Wed, 3 Apr 2024 17:19:28 -0700 Subject: [PATCH] Use the default action button style for VPN onboarding (#2529) Task/Issue URL: https://app.asana.com/0/1199230911884351/1206958823796186/f Tech Design URL: CC: Description: This PR changes the onboarding button style to the default action style, to fix UX problems where the button doesn't appear clickable enough. --- .../PromptActionView/PromptActionView.swift | 31 +------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/LocalPackages/NetworkProtectionMac/Sources/NetworkProtectionUI/Views/PromptActionView/PromptActionView.swift b/LocalPackages/NetworkProtectionMac/Sources/NetworkProtectionUI/Views/PromptActionView/PromptActionView.swift index 8304b3ac0b..ab497e050b 100644 --- a/LocalPackages/NetworkProtectionMac/Sources/NetworkProtectionUI/Views/PromptActionView/PromptActionView.swift +++ b/LocalPackages/NetworkProtectionMac/Sources/NetworkProtectionUI/Views/PromptActionView/PromptActionView.swift @@ -30,35 +30,6 @@ fileprivate extension View { .foregroundColor(Color(.defaultText)) } - @ViewBuilder - func applyStepButtonAttributes(colorScheme: ColorScheme) -> some View { - switch colorScheme { - case .dark: - self.buttonStyle(.plain) - .padding(.horizontal, 12) - .padding(.vertical, 0) - .frame(height: 20, alignment: .center) - .background(Color(.onboardingButtonBackgroundColor)) - .cornerRadius(5) - .shadow(color: .black.opacity(0.2), radius: 0.5, x: 0, y: 1) - .shadow(color: .black.opacity(0.05), radius: 0.5, x: 0, y: 0) - .shadow(color: .black.opacity(0.1), radius: 0, x: 0, y: 0) - default: - self.buttonStyle(.plain) - .padding(.horizontal, 12) - .padding(.vertical, 0) - .frame(height: 20, alignment: .center) - .background(Color(.onboardingButtonBackgroundColor)) - .cornerRadius(5) - .shadow(color: .black.opacity(0.1), radius: 0.5, x: 0, y: 1) - .shadow(color: .black.opacity(0.05), radius: 0.5, x: 0, y: 0) - .overlay( - RoundedRectangle(cornerRadius: 5) - .inset(by: -0.25) - .stroke(.black.opacity(0.1), lineWidth: 0.5) - ) - } - } } struct PromptActionView: View { @@ -95,7 +66,7 @@ struct PromptActionView: View { .multilineText() Button(model.actionTitle, action: model.action) - .applyStepButtonAttributes(colorScheme: colorScheme) + .keyboardShortcut(.defaultAction) .padding(.top, 3) }