2020-06-30 18:03:33 +02:00
|
|
|
//
|
|
|
|
// TimelineContainerView.swift
|
|
|
|
// NetNewsWire
|
|
|
|
//
|
|
|
|
// Created by Maurice Parker on 6/30/20.
|
|
|
|
// Copyright © 2020 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import SwiftUI
|
2020-07-01 18:13:11 +02:00
|
|
|
import Account
|
2020-06-30 18:03:33 +02:00
|
|
|
|
|
|
|
struct TimelineContainerView: View {
|
|
|
|
|
2020-07-12 01:22:47 +02:00
|
|
|
@Environment(\.undoManager) var undoManager
|
2020-06-30 18:03:33 +02:00
|
|
|
@EnvironmentObject private var sceneModel: SceneModel
|
2020-07-11 19:47:13 +02:00
|
|
|
var feeds: [Feed]? = nil
|
2020-06-30 18:03:33 +02:00
|
|
|
|
|
|
|
@ViewBuilder var body: some View {
|
2020-07-11 19:47:13 +02:00
|
|
|
if let feeds = feeds {
|
2020-07-01 18:13:11 +02:00
|
|
|
TimelineView()
|
2020-07-05 21:52:04 +02:00
|
|
|
.modifier(TimelineToolbarModifier())
|
2020-07-12 01:22:47 +02:00
|
|
|
.environmentObject(sceneModel.timelineModel)
|
2020-07-01 18:13:11 +02:00
|
|
|
.onAppear {
|
2020-07-12 01:22:47 +02:00
|
|
|
sceneModel.timelineModel.undoManager = undoManager
|
2020-07-12 21:43:52 +02:00
|
|
|
sceneModel.timelineModel.fetchArticles(feeds: feeds)
|
2020-07-01 18:13:11 +02:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
EmptyView()
|
|
|
|
}
|
2020-06-30 18:03:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|