1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-14 06:10:32 +05:30
yattee/Shared/ContentView.swift
2021-07-30 00:45:24 +02:00

35 lines
885 B
Swift

import SwiftUI
struct ContentView: View {
@StateObject private var navigationState = NavigationState()
@StateObject private var searchState = SearchState()
#if os(iOS)
@Environment(\.horizontalSizeClass) private var horizontalSizeClass
#endif
var body: some View {
Section {
#if os(iOS)
if horizontalSizeClass == .compact {
AppTabNavigation()
} else {
AppSidebarNavigation()
}
#elseif os(macOS)
AppSidebarNavigation()
#elseif os(tvOS)
TVNavigationView()
#endif
}
.environmentObject(navigationState)
.environmentObject(searchState)
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}