Skip to content

Commit 945e43f

Browse files
committed
Remove action background view
1 parent 2ee2de0 commit 945e43f

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

WooCommerce/Classes/Tools/Notices/NoticeView.swift

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ class NoticeView: UIView {
88

99
private let backgroundContainerView = UIView()
1010
private let backgroundView: UIVisualEffectView
11-
private let actionBackgroundView = UIView()
1211
private let shadowLayer = CAShapeLayer()
1312
private let shadowMaskLayer = CAShapeLayer()
1413

@@ -138,20 +137,13 @@ private extension NoticeView {
138137
}
139138

140139
func configureActionButton() {
141-
contentStackView.addArrangedSubview(actionBackgroundView)
142-
actionBackgroundView.translatesAutoresizingMaskIntoConstraints = false
143-
144-
actionBackgroundView.layoutMargins = .zero
145-
actionBackgroundView.addSubview(actionButton)
146-
actionButton.translatesAutoresizingMaskIntoConstraints = false
140+
contentStackView.addArrangedSubview(actionButton)
147141

148142
NSLayoutConstraint.activate([
149-
actionBackgroundView.topAnchor.constraint(equalTo: backgroundView.contentView.topAnchor),
150-
actionBackgroundView.bottomAnchor.constraint(equalTo: backgroundView.contentView.bottomAnchor),
143+
actionButton.topAnchor.constraint(equalTo: backgroundView.contentView.topAnchor),
144+
actionButton.bottomAnchor.constraint(equalTo: backgroundView.contentView.bottomAnchor),
151145
])
152146

153-
actionBackgroundView.pinSubviewToAllEdgeMargins(actionButton)
154-
155147
actionButton.titleLabel?.font = Fonts.actionButtonFont
156148
actionButton.setTitleColor(Appearance.actionColor, for: .normal)
157149
actionButton.addTarget(self, action: #selector(actionButtonTapped), for: .touchUpInside)
@@ -184,8 +176,9 @@ private extension NoticeView {
184176

185177
if let actionTitle = notice.actionTitle {
186178
actionButton.setTitle(actionTitle, for: .normal)
179+
actionButton.isHidden = false
187180
} else {
188-
actionBackgroundView.isHidden = true
181+
actionButton.isHidden = true
189182
}
190183
}
191184
}

0 commit comments

Comments
 (0)