From e7e9367896351e4b0c2324d96060e9b87edc509e Mon Sep 17 00:00:00 2001 From: Trey t Date: Tue, 27 Dec 2022 15:27:16 -0600 Subject: [PATCH] add in why subscribe text --- Shared/views/MonthView/MonthView.swift | 2 +- Shared/views/PurchaseButtonView.swift | 18 ++++++++++-------- Shared/views/SettingsView/SettingsView.swift | 2 +- Shared/views/YearView/YearView.swift | 2 +- en.lproj/Localizable.strings | 1 + 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Shared/views/MonthView/MonthView.swift b/Shared/views/MonthView/MonthView.swift index 80f79bd..50f674a 100644 --- a/Shared/views/MonthView/MonthView.swift +++ b/Shared/views/MonthView/MonthView.swift @@ -86,7 +86,7 @@ struct MonthView: View { if iapManager.showIAP { VStack { Spacer() - PurchaseButtonView(height: 175, iapManager: iapManager) + PurchaseButtonView(iapManager: iapManager) } } else if iapManager.showIAPWarning { VStack { diff --git a/Shared/views/PurchaseButtonView.swift b/Shared/views/PurchaseButtonView.swift index f96e488..5bf02a0 100644 --- a/Shared/views/PurchaseButtonView.swift +++ b/Shared/views/PurchaseButtonView.swift @@ -15,12 +15,10 @@ struct PurchaseButtonView: View { var iapManager: IAPManager - private let height: Float private let showCountdownTimer: Bool private let showManageSubClosure: (() -> Void)? - public init(height: Float, iapManager: IAPManager, showManageSubClosure: (() -> Void)? = nil, showCountdownTimer: Bool = false) { - self.height = height + public init(iapManager: IAPManager, showManageSubClosure: (() -> Void)? = nil, showCountdownTimer: Bool = false) { self.showManageSubClosure = showManageSubClosure self.iapManager = iapManager self.showCountdownTimer = showCountdownTimer @@ -34,12 +32,10 @@ struct PurchaseButtonView: View { case true: VStack { buyOptionsView - .frame(height: CGFloat(height)) .background(theme.currentTheme.secondaryBGColor) } case false: subscribedView - .frame(height: CGFloat(height)) .background(theme.currentTheme.secondaryBGColor) } } @@ -51,7 +47,6 @@ struct PurchaseButtonView: View { Text(String(localized: "purchase_view_title")) .foregroundColor(textColor) .frame(minWidth: 0, maxWidth: .infinity, alignment: .leading) - .frame(height: 50) .padding([.leading, .trailing]) VStack(alignment: .leading) { ForEach(iapManager.sortedSubscriptionKeysByPriceOptions, id: \.self) { product in @@ -98,6 +93,7 @@ struct PurchaseButtonView: View { .bold() .foregroundColor(textColor) .frame(minWidth: 0, maxWidth: .infinity, alignment: .leading) + .padding(.top) if showCountdownTimer { if let date = Calendar.current.date(byAdding: .day, value: 30, to: firstLaunchDate) { @@ -126,6 +122,11 @@ struct PurchaseButtonView: View { } .frame(minWidth: 0, maxWidth: .infinity, alignment: .leading) } + + Text(String(localized: "purchase_view_current_why_subscribe")) + .font(.body) + .bold() + .foregroundColor(textColor) } HStack { ForEach(iapManager.sortedSubscriptionKeysByPriceOptions) { product in @@ -137,6 +138,7 @@ struct PurchaseButtonView: View { .bold() .frame(maxWidth: .infinity) .contentShape(Rectangle()) + .frame(height: 65) }) .padding() .frame(maxWidth: .infinity) @@ -159,7 +161,7 @@ struct PurchaseButtonView: View { VStack(alignment: .leading) { Text(String(localized: "purchase_view_current_subscription")) .font(.title3) - .padding(.leading) + .padding([.leading, .top]) Divider() @@ -229,6 +231,6 @@ struct PurchaseButtonView: View { struct PurchaseButtonView_Previews: PreviewProvider { static var previews: some View { - PurchaseButtonView(height: 175, iapManager: IAPManager()) + PurchaseButtonView(iapManager: IAPManager()) } } diff --git a/Shared/views/SettingsView/SettingsView.swift b/Shared/views/SettingsView/SettingsView.swift index b2e4e5f..adbdbb4 100644 --- a/Shared/views/SettingsView/SettingsView.swift +++ b/Shared/views/SettingsView/SettingsView.swift @@ -150,7 +150,7 @@ struct SettingsView: View { ZStack { theme.currentTheme.secondaryBGColor VStack { - PurchaseButtonView(height: iapManager.currentSubscription != nil ? 300 : 200, iapManager: iapManager, showManageSubClosure: { + PurchaseButtonView(iapManager: iapManager, showManageSubClosure: { Task { await self.showManageSubscription() diff --git a/Shared/views/YearView/YearView.swift b/Shared/views/YearView/YearView.swift index 6c535ed..7b65f58 100644 --- a/Shared/views/YearView/YearView.swift +++ b/Shared/views/YearView/YearView.swift @@ -67,7 +67,7 @@ struct YearView: View { if iapManager.showIAP { VStack { Spacer() - PurchaseButtonView(height: 175, iapManager: iapManager) + PurchaseButtonView(iapManager: iapManager) } } else if iapManager.showIAPWarning { VStack { diff --git a/en.lproj/Localizable.strings b/en.lproj/Localizable.strings index 880b426..7b14e88 100644 --- a/en.lproj/Localizable.strings +++ b/en.lproj/Localizable.strings @@ -115,6 +115,7 @@ "purchase_view_cancel" = "Cancel"; "purchase_view_current_subscription" = "Current Subscription"; "purchase_view_current_subscription_expires_in" = "Trial expires in:"; +"purchase_view_current_why_subscribe" = "Subscription will give you access to historical data grouped by Month and Year"; "purchase_view_current_subscription_expired_on" = "Trial expired on:"; "purchase_view_loading" = "Loading subscription options"; "purchase_view_restore" = "Restore";