This commit is contained in:
Trey t
2025-12-09 23:36:57 -06:00
parent 316513e516
commit 3a10b4b8d6
1586 changed files with 0 additions and 7710 deletions

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