wip
This commit is contained in:
57
Shared/Views/IAPWarningView.swift
Normal file
57
Shared/Views/IAPWarningView.swift
Normal file
@@ -0,0 +1,57 @@
|
||||
//
|
||||
// IAPWarningView.swift
|
||||
// Feels
|
||||
//
|
||||
// Trial warning banner shown at bottom of Month/Year views.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct IAPWarningView: View {
|
||||
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
|
||||
@AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = DefaultTextColor.textColor
|
||||
|
||||
@ObservedObject var iapManager: IAPManager
|
||||
|
||||
@State private var showSubscriptionStore = false
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: 8) {
|
||||
HStack {
|
||||
Image(systemName: "clock")
|
||||
.foregroundColor(.orange)
|
||||
|
||||
Text(String(localized: "iap_warning_view_title"))
|
||||
.font(.body)
|
||||
.foregroundColor(textColor)
|
||||
|
||||
if let expirationDate = iapManager.trialExpirationDate {
|
||||
Text(expirationDate, style: .relative)
|
||||
.font(.body)
|
||||
.bold()
|
||||
.foregroundColor(.orange)
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
showSubscriptionStore = true
|
||||
} label: {
|
||||
Text(String(localized: "iap_warning_view_buy_button"))
|
||||
.font(.headline)
|
||||
.foregroundColor(.white)
|
||||
.frame(maxWidth: .infinity)
|
||||
.padding(.vertical, 12)
|
||||
.background(RoundedRectangle(cornerRadius: 10).fill(Color.pink))
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
.background(theme.currentTheme.secondaryBGColor)
|
||||
.sheet(isPresented: $showSubscriptionStore) {
|
||||
FeelsSubscriptionStoreView()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
IAPWarningView(iapManager: IAPManager())
|
||||
}
|
||||
Reference in New Issue
Block a user