add in why subscribe text
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user