2020-06-30 11:03:33 -05:00
|
|
|
//
|
|
|
|
// TimelineContainerView.swift
|
|
|
|
// NetNewsWire
|
|
|
|
//
|
|
|
|
// Created by Maurice Parker on 6/30/20.
|
|
|
|
// Copyright © 2020 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import SwiftUI
|
2020-07-01 11:13:11 -05:00
|
|
|
import Account
|
2020-06-30 11:03:33 -05:00
|
|
|
|
|
|
|
struct TimelineContainerView: View {
|
|
|
|
|
|
|
|
@EnvironmentObject private var sceneModel: SceneModel
|
|
|
|
@StateObject private var timelineModel = TimelineModel()
|
2020-07-01 11:13:11 -05:00
|
|
|
var feed: Feed? = nil
|
2020-06-30 11:03:33 -05:00
|
|
|
|
|
|
|
@ViewBuilder var body: some View {
|
2020-07-01 11:13:11 -05:00
|
|
|
if let feed = feed {
|
|
|
|
TimelineView()
|
2020-07-06 21:14:05 -05:00
|
|
|
.modifier(TimelineTitleModifier(title: feed.nameForDisplay))
|
2020-07-05 14:52:04 -05:00
|
|
|
.modifier(TimelineToolbarModifier())
|
2020-07-01 11:13:11 -05:00
|
|
|
.environmentObject(timelineModel)
|
|
|
|
.onAppear {
|
|
|
|
sceneModel.timelineModel = timelineModel
|
|
|
|
timelineModel.delegate = sceneModel
|
|
|
|
timelineModel.rebuildTimelineItems(feed)
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
EmptyView()
|
|
|
|
}
|
2020-06-30 11:03:33 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|