mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-12 01:17:29 +01:00
01a84a2a40
Also moved view model to separate file and removed the view prefix.
38 lines
910 B
Swift
38 lines
910 B
Swift
//
|
|
// CompactSidebarContainerView.swift
|
|
// Multiplatform iOS
|
|
//
|
|
// Created by Stuart Breckenridge on 29/6/20.
|
|
// Copyright © 2020 Ranchero Software. All rights reserved.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct CompactSidebarContainerView: View {
|
|
|
|
@EnvironmentObject private var sceneModel: SceneModel
|
|
@StateObject private var sidebarModel = SidebarModel()
|
|
@State private var showSettings: Bool = false
|
|
|
|
var body: some View {
|
|
SidebarView()
|
|
.modifier(SidebarToolbar())
|
|
.environmentObject(sidebarModel)
|
|
.navigationBarTitle(Text("Feeds"))
|
|
.listStyle(PlainListStyle())
|
|
.onAppear {
|
|
sceneModel.sidebarModel = sidebarModel
|
|
sidebarModel.delegate = sceneModel
|
|
sidebarModel.rebuildSidebarItems()
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
struct CompactSidebarContainerView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
CompactSidebarContainerView()
|
|
.environmentObject(SceneModel())
|
|
}
|
|
}
|