mirror of
https://github.com/luxfhe/example-ios-demo.git
synced 2026-10-30 18:13:24 +00:00
This app is ZAMA's BSD 3-Clause Clear demo. The license requires its notices to survive redistribution, and a rebrand had replaced every one of them with ours: the LICENSE text, 66 source headers and the app's copyright string. They are back, each with our line beside it for our changes. Co-authored-by: Hanzo Dev <[email protected]>
51 lines
1.4 KiB
Swift
51 lines
1.4 KiB
Swift
// Copyright © 2025 Zama. All rights reserved.
|
|
// Copyright © 2025 Lux Industries Inc.
|
|
|
|
import SwiftUI
|
|
|
|
#Preview {
|
|
DataVaultRoot()
|
|
}
|
|
|
|
struct DataVaultRoot: View {
|
|
@State private var selectedTab: DataVaultTab = .home
|
|
@StateObject private var healthVM = HealthViewModel()
|
|
|
|
var body: some View {
|
|
TabView(selection: $selectedTab) {
|
|
tabItem(value: .home) {
|
|
HomeTab(selectedTab: $selectedTab)
|
|
}
|
|
|
|
tabItem(value: .sleep) {
|
|
SleepTab(vm: healthVM)
|
|
}
|
|
|
|
tabItem(value: .weight) {
|
|
WeightTab(vm: healthVM)
|
|
}
|
|
|
|
tabItem(value: .profile) {
|
|
ProfileTab()
|
|
}
|
|
}
|
|
.padding(.top, 30)
|
|
.tint(.luxYellow)
|
|
.overlay(alignment: .topTrailing) {
|
|
LuxLink()
|
|
}
|
|
.onOpenURL { url in
|
|
selectedTab = DataVaultTab(url: url) ?? .home
|
|
}
|
|
}
|
|
|
|
@TabContentBuilder<DataVaultTab>
|
|
private func tabItem<Content: View>(value: DataVaultTab, @ViewBuilder content: () -> Content) -> some TabContent<DataVaultTab> {
|
|
Tab(value.displayInfo.name, systemImage: value.displayInfo.icon, value: value) {
|
|
content()
|
|
.toolbarBackground(Color.luxBlackTabBar, for: .tabBar)
|
|
.toolbarBackground(.visible, for: .tabBar)
|
|
}
|
|
}
|
|
}
|