Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}
}
Expand Down
28 changes: 28 additions & 0 deletions Sources/Monext/Utils/DisableCardArtIfAvailable.swift
Original file line number Diff line number Diff line change
@@ -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)
}
}
}
Loading