Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ButtonLink design #610

Merged
merged 6 commits into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified Snapshots/iPad/AlertTests/testAlerts.1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Snapshots/iPad/ButtonLinkTests/testButtonLinks.1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Snapshots/iPad/ButtonLinkTests/testButtonLinks.2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Snapshots/iPad/ButtonTests/testButtons.1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Snapshots/iPad/ButtonTests/testButtons.2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Snapshots/iPad/DialogTests/testDialog.1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Snapshots/iPad/EmptyStateTests/testEmptyStates.1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Snapshots/iPad/SocialButtonTests/testSocialButtons.1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Snapshots/iPhone/AlertTests/testAlerts.1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Snapshots/iPhone/ButtonLinkTests/testButtonLinks.1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Snapshots/iPhone/ButtonLinkTests/testButtonLinks.2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Snapshots/iPhone/ButtonTests/testButtons.1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Snapshots/iPhone/ButtonTests/testButtons.2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Snapshots/iPhone/DialogTests/testDialog.1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Snapshots/iPhone/EmptyStateTests/testEmptyStates.1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Snapshots/iPhone/SocialButtonTests/testSocialButtons.1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 6 additions & 4 deletions Sources/Orbit/Components/Alert.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ public struct Alert<Content: View, Icon: View>: View {
}

if let button {
Button(button.label, type: primaryButtonType, size: .small, action: button.action)
.fixedSize(horizontal: true, vertical: false)
Button(button.label, type: primaryButtonType, action: button.action)
.buttonSize(.compact)
.idealSize()
.padding(.xSmall)
.padding(.top, 3)
.accessibility(.alertButtonPrimary)
Expand Down Expand Up @@ -119,7 +120,7 @@ public struct Alert<Content: View, Icon: View>: View {
switch buttons {
case .primary(let primaryButton),
.primaryAndSecondary(let primaryButton, _):
Button(primaryButton.label, type: primaryButtonType, size: .small, action: primaryButton.action)
Button(primaryButton.label, type: primaryButtonType, action: primaryButton.action)
.accessibility(.alertButtonPrimary)
case .none, .secondary, .inline:
EmptyView()
Expand All @@ -128,12 +129,13 @@ public struct Alert<Content: View, Icon: View>: View {
switch buttons {
case .secondary(let secondaryButton),
.primaryAndSecondary(_, let secondaryButton):
Button(secondaryButton.label, type: secondaryButtonType, size: .small, action: secondaryButton.action)
Button(secondaryButton.label, type: secondaryButtonType, action: secondaryButton.action)
.accessibility(.alertButtonSecondary)
case .none, .primary, .inline:
EmptyView()
}
}
.buttonSize(.compact)
case .none, .inline:
EmptyView()
}
Expand Down
Loading