item-atlas/apps/ios/ItemAtlas/ItemAtlasApp.swift

33 lines
1.2 KiB
Swift

import SwiftUI
@main
struct ItemAtlasApp: App {
@State private var store = InventoryStore()
var body: some Scene {
WindowGroup {
if let startupError = store.startupError {
ContentUnavailableView("无法打开物品台账", systemImage: "externaldrive.badge.exclamationmark",
description: Text(startupError))
} else {
TabView {
InventoryView(store: store)
.tabItem { Label("找物", systemImage: "magnifyingglass") }
LocationView(store: store)
.tabItem { Label("位置", systemImage: "square.stack") }
IntakeView(store: store)
.tabItem { Label("录入", systemImage: "square.and.pencil") }
InventoryView(store: store, favoritesOnly: true)
.tabItem { Label("收藏", systemImage: "star") }
}
.tint(.atlasBlue)
}
}
}
}
extension Color {
static let atlasNavy = Color(red: 0.09, green: 0.15, blue: 0.28)
static let atlasBlue = Color(red: 0.19, green: 0.32, blue: 0.81)
}