add in why subscribe text

This commit is contained in:
Trey t
2022-12-27 15:27:16 -06:00
parent 384a57a4bd
commit e7e9367896
5 changed files with 14 additions and 11 deletions

View File

@@ -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 {

View File

@@ -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())
}
}

View File

@@ -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()

View File

@@ -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 {