37 lines
1.1 KiB
Swift
37 lines
1.1 KiB
Swift
import SwiftUI
|
|
import SwiftData
|
|
|
|
struct RootTabView: View {
|
|
@Environment(AppState.self) private var appState
|
|
|
|
var body: some View {
|
|
@Bindable var appState = appState
|
|
TabView(selection: $appState.selectedTab) {
|
|
Tab(String.localized("My Cards"), systemImage: "rectangle.stack", value: AppTab.cards) {
|
|
CardsHomeView()
|
|
}
|
|
|
|
Tab(String.localized("Share"), systemImage: "qrcode", value: AppTab.share) {
|
|
ShareCardView()
|
|
}
|
|
|
|
Tab(String.localized("Customize"), systemImage: "slider.horizontal.3", value: AppTab.customize) {
|
|
CustomizeCardView()
|
|
}
|
|
|
|
Tab(String.localized("Contacts"), systemImage: "person.2", value: AppTab.contacts) {
|
|
ContactsView()
|
|
}
|
|
|
|
Tab(String.localized("Widgets"), systemImage: "square.grid.2x2", value: AppTab.widgets) {
|
|
WidgetsView()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
RootTabView()
|
|
.environment(AppState(modelContext: try! ModelContainer(for: BusinessCard.self, Contact.self).mainContext))
|
|
}
|