Skip to content

Commit f21599a

Browse files
committed
fix contentPaddings
- renamed to innerBarPadding - moved to extension ProgressBarVM
1 parent 4d508f6 commit f21599a

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

Sources/ComponentsKit/ProgressBar/Models/ProgressBarVM.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,17 @@ public struct ProgressBarVM: ComponentVM {
2828
/// Defaults to `.medium`.
2929
public var cornerRadius: ComponentRadius = .medium
3030

31-
/// The padding applied to the modal's content area.
32-
///
33-
/// Defaults to a padding value of `3` for all sides.
34-
public var contentPaddings: Paddings = .init(padding: 3)
35-
3631
/// Initializes a new instance of `ProgressBarVM` with default values.
3732
public init() {}
3833
}
3934

4035
// MARK: - Shared Helpers
4136

4237
extension ProgressBarVM {
38+
var innerBarPadding: CGFloat {
39+
return 3
40+
}
41+
4342
var barHeight: CGFloat {
4443
switch self.style {
4544
case .light:

Sources/ComponentsKit/ProgressBar/SUProgressBar.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ public struct SUProgressBar: View {
5959
RoundedRectangle(cornerRadius: self.model.innerCornerRadius)
6060
.foregroundStyle(self.model.color.contrast.color)
6161
.frame(width: (geometry.size.width - 6) * self.progress, height: self.model.barHeight - 6)
62-
.padding(.vertical, self.model.contentPaddings.top)
63-
.padding(.horizontal, self.model.contentPaddings.trailing)
62+
.padding(.vertical, self.model.innerBarPadding)
63+
.padding(.horizontal, self.model.innerBarPadding)
6464
}
6565
.animation(.spring, value: self.progress)
6666

@@ -73,8 +73,8 @@ public struct SUProgressBar: View {
7373
RoundedRectangle(cornerRadius: self.model.innerCornerRadius)
7474
.foregroundStyle(self.model.color.contrast.color)
7575
.frame(width: (geometry.size.width - 6) * self.progress, height: self.model.barHeight - 6)
76-
.padding(.vertical, self.model.contentPaddings.top)
77-
.padding(.horizontal, self.model.contentPaddings.trailing)
76+
.padding(.vertical, self.model.innerBarPadding)
77+
.padding(.horizontal, self.model.innerBarPadding)
7878

7979
StripesShape(model: self.model)
8080
.foregroundStyle(self.model.color.main.color)

0 commit comments

Comments
 (0)