a bunch more usability improvements
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -148,7 +148,7 @@ struct ChatView: View {
|
||||
.contentShape(Rectangle())
|
||||
.id(event.id)
|
||||
.frame(minHeight: just_started ? PFP_SIZE : 0)
|
||||
//.padding([.bottom], next_ev == nil ? 2 : 0)
|
||||
.padding([.bottom], next_ev == nil ? 30 : 0)
|
||||
//.border(Color.green)
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ struct ThreadView: View {
|
||||
|
||||
@EnvironmentObject var profiles: Profiles
|
||||
@EnvironmentObject var thread: ThreadModel
|
||||
@Environment(\.dismiss) var dismiss
|
||||
|
||||
var body: some View {
|
||||
Group {
|
||||
@@ -35,6 +36,9 @@ struct ThreadView: View {
|
||||
}
|
||||
*/
|
||||
}
|
||||
.onReceive(NotificationCenter.default.publisher(for: .switched_timeline)) { n in
|
||||
dismiss()
|
||||
}
|
||||
.onReceive(NotificationCenter.default.publisher(for: .toggle_thread_view)) { _ in
|
||||
is_chatroom = !is_chatroom
|
||||
//print("is_chatroom: \(is_chatroom)")
|
||||
|
||||
@@ -26,22 +26,30 @@ struct TimelineView: View {
|
||||
}
|
||||
|
||||
var MainContent: some View {
|
||||
ScrollView {
|
||||
LazyVStack {
|
||||
ForEach(events, id: \.id) { (ev: NostrEvent) in
|
||||
/*
|
||||
let evdet = EventDetailView(thread: ThreadModel(event: ev, pool: pool))
|
||||
.navigationBarTitle("Thread")
|
||||
.padding([.leading, .trailing], 6)
|
||||
.environmentObject(profiles)
|
||||
*/
|
||||
|
||||
EventView(event: ev, highlight: .none, has_action_bar: true)
|
||||
.onTapGesture {
|
||||
NotificationCenter.default.post(name: .open_thread, object: ev)
|
||||
}
|
||||
ScrollViewReader { scroller in
|
||||
ScrollView {
|
||||
LazyVStack {
|
||||
ForEach(events, id: \.id) { (ev: NostrEvent) in
|
||||
/*
|
||||
let evdet = EventDetailView(thread: ThreadModel(event: ev, pool: pool))
|
||||
.navigationBarTitle("Thread")
|
||||
.padding([.leading, .trailing], 6)
|
||||
.environmentObject(profiles)
|
||||
*/
|
||||
|
||||
EventView(event: ev, highlight: .none, has_action_bar: true)
|
||||
.onTapGesture {
|
||||
NotificationCenter.default.post(name: .open_thread, object: ev)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.onReceive(NotificationCenter.default.publisher(for: .scroll_to_top)) { _ in
|
||||
guard let event = events.first else {
|
||||
return
|
||||
}
|
||||
scroll_to_event(scroller: scroller, id: event.id, delay: 0.0, animate: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user