Skip to content

Commit

Permalink
Use buttonSize for other components plus generic button style for But…
Browse files Browse the repository at this point in the history
…ton and SocialButton
  • Loading branch information
PavelHolec committed Jun 26, 2023
1 parent cb2def8 commit 37c284f
Show file tree
Hide file tree
Showing 12 changed files with 172 additions and 279 deletions.
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

0 comments on commit 37c284f

Please sign in to comment.