damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit 85ba7bbed0fceabfdd20ee55b88dd7593cb7d5f7
parent 79f422397704d73140f7d375e0bcb715709a0156
Author: Thomas Rademaker <thomas@sparrowtek.com>
Date:   Thu, 22 Dec 2022 15:46:35 -0500

ContentTimelineView inside a page tabView

To get a nice swipe gesture

Closes: #103

Changelog-Changed: Add swipe gesture between posts and post & replies

Diffstat:
Mdamus/ContentView.swift | 30++++++++++++++++++++----------
1 file changed, 20 insertions(+), 10 deletions(-)

diff --git a/damus/ContentView.swift b/damus/ContentView.swift @@ -78,17 +78,14 @@ struct ContentView: View { @Environment(\.colorScheme) var colorScheme var PostingTimelineView: some View { - VStack{ - ZStack { - if let damus = self.damus_state { - TimelineView(events: $home.events, loading: $home.loading, damus: damus, show_friend_icon: false, filter: filter_event) - } - if privkey != nil { - PostButtonContainer { - self.active_sheet = .post - } - } + VStack { + TabView(selection: $filter_state) { + ContentTimelineView + .tag(FilterState.posts) + ContentTimelineView + .tag(FilterState.posts_and_replies) } + .tabViewStyle(.page(indexDisplayMode: .never)) } .safeAreaInset(edge: .top) { VStack(spacing: 0) { @@ -102,6 +99,19 @@ struct ContentView: View { } } + var ContentTimelineView: some View { + ZStack { + if let damus = self.damus_state { + TimelineView(events: $home.events, loading: $home.loading, damus: damus, show_friend_icon: false, filter: filter_event) + } + if privkey != nil { + PostButtonContainer { + self.active_sheet = .post + } + } + } + } + var FiltersView: some View { VStack{ Picker("Filter State", selection: $filter_state) {