This commit is contained in:
Trey t
2022-12-23 09:43:48 -06:00
parent 49e3812659
commit 488832b777
9 changed files with 195 additions and 167 deletions

View File

@@ -17,6 +17,7 @@ struct IAPWarningView: View {
private let height: Float
private let showManageSubClosure: (() -> Void)?
@State private var showSettings = false
public init(height: Float, iapManager: IAPManager, showManageSubClosure: (() -> Void)? = nil, showCountdownTimer: Bool = false) {
@@ -27,25 +28,31 @@ struct IAPWarningView: View {
var body: some View {
VStack {
Text(String(format: String(localized: "iap_warning_view_title"), iapManager.daysLeftBeforeIAP))
.font(.body)
.frame(minWidth: 0, maxWidth: .infinity)
.background(theme.currentTheme.secondaryBGColor)
Button(action: {
showSettings.toggle()
}, label: {
Text(String(localized: "iap_warning_view_buy_button"))
.foregroundColor(.white)
if let date = Calendar.current.date(byAdding: .day, value: 30, to: firstLaunchDate) {
Text(String(localized: "iap_warning_view_title"))
.font(.body)
.frame(minWidth: 0, maxWidth: .infinity)
.background(theme.currentTheme.secondaryBGColor)
Text(date, style: .relative)
.font(.body)
.bold()
.frame(maxWidth: .infinity)
.contentShape(Rectangle())
})
.frame(maxWidth: .infinity)
.frame(height: 50)
.background(RoundedRectangle(cornerRadius: 10).fill(DefaultMoodTint.color(forMood: .great)))
.foregroundColor(textColor)
Button(action: {
showSettings.toggle()
}, label: {
Text(String(localized: "iap_warning_view_buy_button"))
.foregroundColor(.white)
.bold()
.frame(maxWidth: .infinity)
.contentShape(Rectangle())
})
.frame(maxWidth: .infinity)
.frame(height: 50)
.background(RoundedRectangle(cornerRadius: 10).fill(DefaultMoodTint.color(forMood: .great)))
}
}
// .frame(height: CGFloat(height))
.frame(minWidth: 0, maxWidth: .infinity)
.padding()
.background(theme.currentTheme.secondaryBGColor)