feat: add iOS support and harden receipt scanning
This commit is contained in:
38
app/ios/ScanReceipts/App/RootView.swift
Normal file
38
app/ios/ScanReceipts/App/RootView.swift
Normal file
@@ -0,0 +1,38 @@
|
||||
import SwiftUI
|
||||
|
||||
/// Top-level router: which screen the user sees is entirely a function of
|
||||
/// `AppState.phase`. Nothing else in the app should make navigation
|
||||
/// decisions based on auth state — route through here instead.
|
||||
struct RootView: View {
|
||||
@EnvironmentObject private var appState: AppState
|
||||
|
||||
var body: some View {
|
||||
Group {
|
||||
switch appState.phase {
|
||||
case .checking:
|
||||
LaunchView()
|
||||
case .signedOut:
|
||||
// Provided by Features/Auth/AuthFlowView.swift
|
||||
AuthFlowView()
|
||||
case .signedIn:
|
||||
// Provided by Features/Root/MainTabView.swift
|
||||
MainTabView()
|
||||
}
|
||||
}
|
||||
.animation(.default, value: appState.phase)
|
||||
}
|
||||
}
|
||||
|
||||
private struct LaunchView: View {
|
||||
var body: some View {
|
||||
VStack(spacing: ZenithSpacing.xs) {
|
||||
Image(systemName: "doc.text.viewfinder")
|
||||
.font(.system(size: 44))
|
||||
.foregroundStyle(.zenithBlack)
|
||||
ProgressView()
|
||||
.tint(.zenithBlack)
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.background(Color.zenithBg)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user