NetNewsWire/Multiplatform/Shared/SceneNavigationView.swift

58 lines
1.2 KiB
Swift
Raw Normal View History

2020-06-28 21:21:43 +02:00
//
// SceneNavigationView.swift
// NetNewsWire
//
// Created by Maurice Parker on 6/28/20.
// Copyright © 2020 Ranchero Software. All rights reserved.
//
import SwiftUI
struct SceneNavigationView: View {
2020-06-29 16:06:00 +02:00
#if os(iOS)
@Environment(\.horizontalSizeClass) private var horizontalSizeClass
#endif
var body: some View {
2020-06-28 21:21:43 +02:00
NavigationView {
#if os(macOS)
RegularSidebarContainerView()
2020-06-29 16:06:00 +02:00
.frame(minWidth: 100, idealWidth: 150, maxWidth: 200, maxHeight: .infinity)
2020-06-28 21:21:43 +02:00
#else
if horizontalSizeClass == .compact {
CompactSidebarContainerView()
} else {
RegularSidebarContainerView()
}
2020-06-28 21:21:43 +02:00
#endif
2020-06-29 16:06:00 +02:00
#if os(iOS)
if horizontalSizeClass != .compact {
Text("Timeline")
.frame(maxWidth: .infinity, maxHeight: .infinity)
}
#else
2020-06-28 21:21:43 +02:00
Text("Timeline")
.frame(maxWidth: .infinity, maxHeight: .infinity)
2020-06-29 16:06:00 +02:00
#endif
2020-06-28 21:21:43 +02:00
#if os(macOS)
Text("None Selected")
.frame(maxWidth: .infinity, maxHeight: .infinity)
.toolbar { Spacer() }
#else
Text("None Selected")
.frame(maxWidth: .infinity, maxHeight: .infinity)
#endif
}
}
}
struct NavigationView_Previews: PreviewProvider {
static var previews: some View {
SceneNavigationView()
.environmentObject(SceneModel())
2020-06-28 21:21:43 +02:00
}
}