File tree Expand file tree Collapse file tree 4 files changed +24
-60
lines changed
Expand file tree Collapse file tree 4 files changed +24
-60
lines changed Original file line number Diff line number Diff line change @@ -50,8 +50,8 @@ public struct PokitIconRButton: View {
5050 . frame ( width: self . size. iconSize. width, height: self . size. iconSize. height)
5151 . foregroundStyle ( self . state. iconColor)
5252 }
53- . padding ( . leading, self . lPadding )
54- . padding ( . trailing, self . tPadding )
53+ . padding ( . leading, self . size . hPadding + 4 )
54+ . padding ( . trailing, self . size . hPadding )
5555 . padding ( . vertical, self . size. vPadding)
5656 . background {
5757 RoundedRectangle ( cornerRadius: shape. radius ( size: self . size) , style: . continuous)
@@ -61,27 +61,6 @@ public struct PokitIconRButton: View {
6161 . stroke ( self . state. backgroundStrokeColor, lineWidth: 1 )
6262 }
6363 }
64- }
65-
66- private var tPadding : CGFloat {
67- switch self . size {
68- case . small:
69- return 8
70- case . medium:
71- return 16
72- case . large:
73- return 20
74- }
75- }
76-
77- private var lPadding : CGFloat {
78- switch self . size {
79- case . small:
80- return 12
81- case . medium:
82- return 20
83- case . large:
84- return 24
85- }
64+ . frame ( minWidth: self . size. minWidth)
8665 }
8766}
Original file line number Diff line number Diff line change @@ -49,8 +49,8 @@ public struct PokitIconLButton: View {
4949 . pokitFont ( self . size. font)
5050 . foregroundStyle ( self . state. textColor)
5151 }
52- . padding ( . leading, self . lPadding )
53- . padding ( . trailing, self . tPadding )
52+ . padding ( . leading, self . size . hPadding )
53+ . padding ( . trailing, self . size . hPadding + 4 )
5454 . padding ( . vertical, self . size. vPadding)
5555 . background {
5656 RoundedRectangle ( cornerRadius: shape. radius ( size: self . size) , style: . continuous)
@@ -60,27 +60,6 @@ public struct PokitIconLButton: View {
6060 . stroke ( self . state. backgroundStrokeColor, lineWidth: 1 )
6161 }
6262 }
63- }
64-
65- private var lPadding : CGFloat {
66- switch self . size {
67- case . small:
68- return 8
69- case . medium:
70- return 16
71- case . large:
72- return 20
73- }
74- }
75-
76- private var tPadding : CGFloat {
77- switch self . size {
78- case . small:
79- return 12
80- case . medium:
81- return 20
82- case . large:
83- return 24
84- }
63+ . frame ( minWidth: self . size. minWidth)
8564 }
8665}
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ public struct PokitTextButton: View {
3939 Text ( self . labelText)
4040 . pokitFont ( self . size. font)
4141 . foregroundStyle ( self . state. textColor)
42- . padding ( . horizontal, self . hPadding)
42+ . padding ( . horizontal, self . size . hPadding)
4343 . padding ( . vertical, self . size. vPadding)
4444 . background {
4545 RoundedRectangle ( cornerRadius: shape. radius ( size: self . size) , style: . continuous)
@@ -49,16 +49,6 @@ public struct PokitTextButton: View {
4949 . stroke ( self . state. backgroundStrokeColor, lineWidth: 1 )
5050 }
5151 }
52- }
53-
54- private var hPadding : CGFloat {
55- switch self . size {
56- case . small:
57- return 12.5
58- case . medium:
59- return 26
60- case . large:
61- return 34.5
62- }
52+ . frame ( minWidth: self . size. minWidth)
6353 }
6454}
Original file line number Diff line number Diff line change @@ -128,6 +128,22 @@ extension PokitButtonStyle.Size {
128128 case . large: return 13
129129 }
130130 }
131+
132+ var hPadding : CGFloat {
133+ switch self {
134+ case . small: return 8
135+ case . medium: return 16
136+ case . large: return 20
137+ }
138+ }
139+
140+ var minWidth : CGFloat {
141+ switch self {
142+ case . small: return 50
143+ case . medium: return 80
144+ case . large: return 100
145+ }
146+ }
131147}
132148
133149extension PokitButtonStyle . Shape {
You can’t perform that action at this time.
0 commit comments