Skip to content

Commit

Permalink
Add Black Boundary on White Button (#273)
Browse files Browse the repository at this point in the history
* add black boundary on white button

* CHANGELOG engry

* add changelog entry to unreleased

* Jax PR feedback

* change black boundary to one point
  • Loading branch information
KunJeongPark committed May 23, 2024
1 parent a6eefaa commit cc01ee2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

# PayPal iOS SDK Release Notes

## unreleased
* PaymentButtons
* Add black boundary around white buttons

## 1.3.1 (2024-04-29)
* FraudProtection
* Include `DeviceID` privacy term in `PrivacyInfo.xcprivacy` file
Expand Down
6 changes: 6 additions & 0 deletions Sources/PaymentButtons/PaymentButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class PaymentButton: UIButton {
self.label = label
self.analyticsService.sendEvent("payment-button:initialized", buttonType: fundingSource.rawValue)
super.init(frame: .zero)
customizeAppearance()
self.addTarget(self, action: #selector(onTap), for: .touchUpInside)
}

Expand Down Expand Up @@ -331,4 +332,9 @@ public class PaymentButton: UIButton {
image.draw(in: CGRect(x: 0.0, y: 0.0, width: size.width, height: size.height))
return UIGraphicsGetImageFromCurrentImageContext()
}

private func customizeAppearance() {
containerView.layer.borderColor = color == .white ? UIColor.black.cgColor : UIColor.clear.cgColor
containerView.layer.borderWidth = color == .white ? 1 : 0
}
}

0 comments on commit cc01ee2

Please sign in to comment.