WIP
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user