Skip to content

Commit

Permalink
Use the default action button style for VPN onboarding (#2529)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
samsymons authored Apr 4, 2024
1 parent b484b1e commit 5a46ee6
Showing 1 changed file with 1 addition and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -95,7 +66,7 @@ struct PromptActionView: View {
.multilineText()

Button(model.actionTitle, action: model.action)
.applyStepButtonAttributes(colorScheme: colorScheme)
.keyboardShortcut(.defaultAction)
.padding(.top, 3)
}

Expand Down

0 comments on commit 5a46ee6

Please sign in to comment.