Skip to content

Commit 4579e44

Browse files
committed
Move values to Constants extension
1 parent 075fcb8 commit 4579e44

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

WooCommerce/Classes/ViewRelated/Top Banner/TopBannerView.swift

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,11 @@ private extension TopBannerView {
179179

180180
func createLabelHolderStackView() -> UIStackView {
181181
labelHolderStackView.addArrangedSubviews([
182-
createSeparatorView(height: 48, width: 0),
182+
createSeparatorView(height: Constants.labelHolderHeight, width: Constants.labelHolderLeftMargin),
183183
infoLabel,
184-
createSeparatorView(height: 48, width: 24)
184+
createSeparatorView(height: Constants.labelHolderHeight, width: Constants.labelHolderRightMargin)
185185
])
186-
labelHolderStackView.spacing = 1
186+
labelHolderStackView.spacing = Constants.labelHolderSpacing
187187
infoLabel.adjustsFontSizeToFitWidth = true
188188

189189
return labelHolderStackView
@@ -343,3 +343,14 @@ private extension TopBannerView {
343343
static let dismissHint = NSLocalizedString("Double-tap to dismiss", comment: "Accessibility hint to dismiss a banner")
344344
}
345345
}
346+
347+
// MARK: - Constants
348+
//
349+
private extension TopBannerView {
350+
enum Constants {
351+
static let labelHolderHeight: CGFloat = 48.0
352+
static let labelHolderLeftMargin: CGFloat = 0.0
353+
static let labelHolderRightMargin: CGFloat = 24.0
354+
static let labelHolderSpacing: CGFloat = 1.0
355+
}
356+
}

0 commit comments

Comments
 (0)