diff --git a/Sources/Monext/Presentation/PaymentMethodScreen/PayButtonSection/ApplePayButton.swift b/Sources/Monext/Presentation/PaymentMethodScreen/PayButtonSection/ApplePayButton.swift index 0daf5f1..91aa67b 100644 --- a/Sources/Monext/Presentation/PaymentMethodScreen/PayButtonSection/ApplePayButton.swift +++ b/Sources/Monext/Presentation/PaymentMethodScreen/PayButtonSection/ApplePayButton.swift @@ -110,11 +110,11 @@ struct ApplePayButton: View { onPaymentAuthorizationChange: authorizationChange ) { EmptyView() -// Text("Apple Pay not supported") } .frame(height: 48) .payWithApplePayButtonStyle(sessionStore.applePayConfiguration.buttonStyle) .clipShape(RoundedRectangle(cornerRadius: sessionStore.appearance.buttonRadius)) + .modifier(DisableCardArtIfAvailable()) } } } diff --git a/Sources/Monext/Utils/DisableCardArtIfAvailable.swift b/Sources/Monext/Utils/DisableCardArtIfAvailable.swift new file mode 100644 index 0000000..d554f59 --- /dev/null +++ b/Sources/Monext/Utils/DisableCardArtIfAvailable.swift @@ -0,0 +1,28 @@ +// +// DisableCardArtIfAvailable.swift +// Monext +// +// Created by lucas bianciotto on 11/03/2026. +// + +import SwiftUI + +/// A `ViewModifier` that disables the card art display on the Apple Pay button +/// introduced in iOS 26. +/// +/// On earlier iOS versions, this modifier has no effect. +/// +/// ## Usage +/// ```swift +/// PayWithApplePayButton(...) +/// .modifier(DisableCardArtIfAvailable()) +/// ``` +struct DisableCardArtIfAvailable: ViewModifier { + func body(content: Content) -> some View { + if #available(iOS 26.0, *) { + AnyView(content.payWithApplePayButtonDisableCardArt()) + } else { + AnyView(content) + } + } +}