diff options
Diffstat (limited to 'DomainDig/RootTabView.swift')
| -rw-r--r-- | DomainDig/RootTabView.swift | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/DomainDig/RootTabView.swift b/DomainDig/RootTabView.swift index 19ea444..2d2b8ed 100644 --- a/DomainDig/RootTabView.swift +++ b/DomainDig/RootTabView.swift @@ -2,8 +2,11 @@ import SwiftUI struct RootTabView: View { @Bindable var viewModel: DomainViewModel + @State private var purchaseService = PurchaseService.shared var body: some View { + let _ = purchaseService.currentTier + TabView { ContentView(viewModel: viewModel) .tabItem { @@ -38,5 +41,27 @@ struct RootTabView: View { Label("Settings", systemImage: "gearshape") } } + .sheet(isPresented: Binding( + get: { viewModel.isPaywallPresented }, + set: { viewModel.isPaywallPresented = $0 } + )) { + PaywallView() + } + .alert(item: Binding( + get: { viewModel.upgradePrompt }, + set: { viewModel.upgradePrompt = $0 } + )) { prompt in + Alert( + title: Text(prompt.title), + message: Text(prompt.message), + primaryButton: .default(Text("Open Paywall")) { + viewModel.upgradePrompt = nil + viewModel.isPaywallPresented = true + }, + secondaryButton: .cancel(Text("Continue")) { + viewModel.upgradePrompt = nil + } + ) + } } } |
