Skip to content

Commit 46bc22a

Browse files
authored
Merge pull request #8333 from woocommerce/task/remove-auxiliarybutton-image
Remove `auxiliaryButtonImage` from `CardPresentModalScanningForReader`
2 parents 4a72b01 + 79c7f66 commit 46bc22a

File tree

3 files changed

+5
-16
lines changed

3 files changed

+5
-16
lines changed

WooCommerce/Classes/ViewModels/CardPresentPayments/CardPresentModalScanningForReader.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ final class CardPresentModalScanningForReader: CardPresentPaymentsModalViewModel
2121

2222
let auxiliaryButtonTitle: String? = nil
2323

24-
let auxiliaryButtonimage: UIImage? = .infoOutlineImage
25-
2624
var auxiliaryAttributedButtonTitle: NSAttributedString? {
2725
let result = NSMutableAttributedString(
2826
string: .localizedStringWithFormat(

WooCommerce/Classes/ViewModels/CardPresentPayments/CardPresentPaymentsModalViewModel.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ protocol CardPresentPaymentsModalViewModel {
3232
/// Provides a title as a NSAttributedString for an auxiliary button
3333
var auxiliaryAttributedButtonTitle: NSAttributedString? { get }
3434

35-
/// Provides an image for the auxiliary button
36-
var auxiliaryButtonimage: UIImage? { get }
37-
3835
/// The title in the bottom section of the modal. Right below the image
3936
var bottomTitle: String? { get }
4037

@@ -109,10 +106,6 @@ extension CardPresentPaymentsModalViewModel {
109106
get { return nil }
110107
}
111108

112-
var auxiliaryButtonimage: UIImage? {
113-
get { return nil }
114-
}
115-
116109
var showLoadingIndicator: Bool {
117110
get { return false }
118111
}

WooCommerce/Classes/ViewRelated/CardPresentPayments/CardPresentPaymentsModalViewController.swift

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,10 @@ private extension CardPresentPaymentsModalViewController {
318318
UIView.performWithoutAnimation {
319319
auxiliaryButton.setTitle(viewModel.auxiliaryButtonTitle, for: .normal)
320320
auxiliaryButton.setAttributedTitle(viewModel.auxiliaryAttributedButtonTitle, for: .normal)
321-
auxiliaryButton.setImage(viewModel.auxiliaryButtonimage, for: .normal)
322-
if viewModel.auxiliaryButtonimage != nil {
323-
var config = UIButton.Configuration.plain()
324-
config.imagePadding = Constants.buttonTitleAndImageSpacing
325-
auxiliaryButton.configuration = config
326-
}
321+
var config = UIButton.Configuration.plain()
322+
config.contentInsets = Constants.auxiliaryButtonInsets
323+
config.titleAlignment = .leading
324+
auxiliaryButton.configuration = config
327325
view.layoutIfNeeded()
328326
}
329327
}
@@ -418,7 +416,7 @@ private extension CardPresentPaymentsModalViewController {
418416
static let extraInfoCustomInsets = UIEdgeInsets(top: 12, left: 10, bottom: 12, right: 10)
419417
static let modalHeight: CGFloat = 382
420418
static let modalWidth: CGFloat = 280
421-
static let buttonTitleAndImageSpacing: CGFloat = 8
419+
static let auxiliaryButtonInsets = NSDirectionalEdgeInsets(top: 8, leading: 8, bottom: 8, trailing: 8)
422420
}
423421
}
424422

0 commit comments

Comments
 (0)