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