Omit included features from donation products

This commit is contained in:
Davide 2025-02-12 11:37:35 +01:00
parent 717a3492bf
commit afe66dad34
No known key found for this signature in database
GPG Key ID: A48836171C759F5E
2 changed files with 17 additions and 6 deletions

View File

@ -85,6 +85,7 @@ private extension DonateView {
iapManager: iapManager,
style: .donation,
product: $0,
withIncludedFeatures: false,
purchasingIdentifier: $purchasingIdentifier,
onComplete: onComplete,
onError: onError

View File

@ -36,6 +36,8 @@ public struct PaywallProductView: View {
private let product: InAppProduct
private let withIncludedFeatures: Bool
private let highlightedFeatures: Set<AppFeature>
@Binding
@ -52,6 +54,7 @@ public struct PaywallProductView: View {
iapManager: IAPManager,
style: PaywallProductViewStyle,
product: InAppProduct,
withIncludedFeatures: Bool = true,
highlightedFeatures: Set<AppFeature> = [],
purchasingIdentifier: Binding<String?>,
onComplete: @escaping (String, InAppPurchaseResult) -> Void,
@ -60,6 +63,7 @@ public struct PaywallProductView: View {
self.iapManager = iapManager
self.style = style
self.product = product
self.withIncludedFeatures = withIncludedFeatures
self.highlightedFeatures = highlightedFeatures
_purchasingIdentifier = purchasingIdentifier
self.onComplete = onComplete
@ -69,13 +73,9 @@ public struct PaywallProductView: View {
public var body: some View {
VStack(alignment: .leading) {
productView
Group {
includedFeaturesButton
.padding(.top, 8)
includedFeaturesList
.if(isPresentingFeatures)
if withIncludedFeatures {
includedFeaturesView
}
.font(.subheadline)
}
}
}
@ -104,6 +104,16 @@ private extension PaywallProductView {
}
}
var includedFeaturesView: some View {
Group {
includedFeaturesButton
.padding(.top, 8)
includedFeaturesList
.if(isPresentingFeatures)
}
.font(.subheadline)
}
var includedFeaturesButton: some View {
Button {
isPresentingFeatures.toggle()