Skip to content

Commit f1c13d3

Browse files
committed
For extraSmall size, update the button to fit to content.
1 parent c8c7442 commit f1c13d3

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

WooCommerce/Classes/POS/Presentation/Reusable Views/Buttons/POSButtonStyle.swift

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,17 @@ struct POSButtonStyle: ButtonStyle {
2727
}
2828

2929
func makeBody(configuration: Configuration) -> some View {
30-
HStack {
31-
Spacer()
32-
configuration.label
33-
Spacer()
30+
Group {
31+
switch size {
32+
case .normal:
33+
HStack {
34+
Spacer()
35+
configuration.label
36+
Spacer()
37+
}
38+
case .extraSmall:
39+
configuration.label
40+
}
3441
}
3542
.padding(.vertical, size.padding.vertical)
3643
.padding(.horizontal, size.padding.horizontal)

0 commit comments

Comments
 (0)