refactor timeline and nav

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2022-04-18 17:33:15 -07:00
parent 5bb46c5d10
commit bcff8d5f02
3 changed files with 73 additions and 44 deletions

View File

@@ -0,0 +1,38 @@
//
// TimelineView.swift
// damus
//
// Created by William Casarin on 2022-04-18.
//
import SwiftUI
struct TimelineView: View {
@Binding var events: [NostrEvent]
@EnvironmentObject var profiles: Profiles
let pool: RelayPool
var body: some View {
ScrollView {
ForEach(events, id: \.id) { (ev: NostrEvent) in
let evdet = EventDetailView(event: ev, pool: pool)
.navigationBarTitle("Thread")
.environmentObject(profiles)
NavigationLink(destination: evdet) {
EventView(event: ev, highlight: .none, has_action_bar: true)
}
.buttonStyle(PlainButtonStyle())
}
}
.environmentObject(profiles)
}
}
/*
struct TimelineView_Previews: PreviewProvider {
static var previews: some View {
TimelineView()
}
}
*/