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

32 lines
779 B
Swift
Raw Normal View History

2021-06-10 02:21:23 +05:30
import SwiftUI
struct ContentView: View {
2021-07-12 02:22:49 +05:30
@StateObject private var navigationState = NavigationState()
2021-07-08 04:09:18 +05:30
2021-07-12 02:22:49 +05:30
#if os(iOS)
@Environment(\.horizontalSizeClass) private var horizontalSizeClass
#endif
2021-06-12 02:41:59 +05:30
2021-06-10 02:21:23 +05:30
var body: some View {
2021-07-12 02:22:49 +05:30
Section {
#if os(iOS)
if horizontalSizeClass == .compact {
AppTabNavigation()
} else {
AppSidebarNavigation()
2021-06-12 02:41:59 +05:30
}
2021-07-12 02:22:49 +05:30
#elseif os(macOS)
AppSidebarNavigation()
#elseif os(tvOS)
TVNavigationView()
#endif
}.environmentObject(navigationState)
2021-07-08 04:09:18 +05:30
}
2021-06-10 02:21:23 +05:30
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}