Skip to content

Commit

Permalink
Merge pull request #231 from paypal/button-color-update
Browse files Browse the repository at this point in the history
Deprecated and updated colors for Payment Buttons
  • Loading branch information
stechiu authored Jan 10, 2024
2 parents 70b6055 + f27faa8 commit 0d8f96a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
# PayPal iOS SDK Release Notes

## unreleased
* PaymentButtons
* Deprecate `PaymentButtonColor` `.black`, `.silver`, `.blue`, and `.darkBlue`
* Add `PaymentButtonColor.gold` for `PayPalCreditButton`

* PayPalWebPayments
* Add `vault(url:)` method to `PayPalWebCheckoutClient`
* Add `PayPalVaultResult` type to return vault result
Expand Down
2 changes: 1 addition & 1 deletion Demo/Demo/Extensions/PaymentButtonEnums+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ extension PayPalButton.Color: CaseIterable {
extension PayPalCreditButton.Color: CaseIterable {

public static var allCases: [PayPalCreditButton.Color] {
[.white, .black, .darkBlue]
[.gold, .white, .black, .darkBlue]
}

static func allCasesAsString() -> [String] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct PayPalWebButtonsView: View {

switch selectedFundingSource {
case .paypalCredit:
PayPalCreditButton.Representable(color: .black, size: .full) {
PayPalCreditButton.Representable(color: .gold, size: .full) {
payPalWebViewModel.paymentButtonTapped(funding: .paypalCredit)
}
case .paylater:
Expand Down
3 changes: 2 additions & 1 deletion Sources/PaymentButtons/PayPalCreditButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ public final class PayPalCreditButton: PaymentButton {
Available colors for PayPalCreditButton.
*/
public enum Color: String {
case gold
case white
case black
case darkBlue

var color: PaymentButtonColor {
PaymentButtonColor(rawValue: rawValue) ?? .darkBlue
PaymentButtonColor(rawValue: rawValue) ?? .white
}
}

Expand Down
10 changes: 5 additions & 5 deletions Sources/PaymentButtons/PaymentButtonColor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ public enum PaymentButtonColor: String {
/// The gold background and blue wordmark, monogram, and black text.
case gold

/// The white background and blue wordmark, monogram, and black text.
/// The white background and blue wordmark, blue border, monogram, and black text.
case white

/// The black background and monochrome wordmark, monogram, and white text.
@available(*, deprecated, message: "Deprecated color. Replace with `white` button color.")
case black

/// The silver background and blue wordmark, monogram, and black text.
@available(*, deprecated, message: "Deprecated color. Replace with `white` button color.")
case silver

/// The blue background and white wordmark, blue monogram, and white text.
@available(*, deprecated, message: "Deprecated color. Replace with `white` button color.")
case blue

/// The dark blue background with PayPal Credit wordmark and monogram.
@available(*, deprecated, message: "Deprecated color. Replace with `white` button color.")
case darkBlue

var color: UIColor {
Expand Down

0 comments on commit 0d8f96a

Please sign in to comment.