1
0
mirror of git://jb55.com/damus synced 2024-09-20 03:57:06 +00:00

Fix duplicate post buttons when swiping tabs

Move the postButtonContainer view to avoid having 2 buttons on screen when swiping tabs

Closes: #366
Changelog-Fixed: Fix duplicate post buttons when swiping tabs
This commit is contained in:
Thomas Rademaker 2023-01-22 09:14:16 -05:00 committed by William Casarin
parent 77c2abc524
commit ced6e2488f

View File

@ -93,15 +93,23 @@ struct ContentView: View {
var PostingTimelineView: some View {
VStack {
TabView(selection: $filter_state) {
contentTimelineView(filter: FilterState.posts.filter)
.tag(FilterState.posts)
.id(FilterState.posts)
contentTimelineView(filter: FilterState.posts_and_replies.filter)
.tag(FilterState.posts_and_replies)
.id(FilterState.posts_and_replies)
ZStack {
TabView(selection: $filter_state) {
contentTimelineView(filter: FilterState.posts.filter)
.tag(FilterState.posts)
.id(FilterState.posts)
contentTimelineView(filter: FilterState.posts_and_replies.filter)
.tag(FilterState.posts_and_replies)
.id(FilterState.posts_and_replies)
}
.tabViewStyle(.page(indexDisplayMode: .never))
if privkey != nil {
PostButtonContainer(userSettings: user_settings) {
self.active_sheet = .post
}
}
}
.tabViewStyle(.page(indexDisplayMode: .never))
}
.safeAreaInset(edge: .top, spacing: 0) {
VStack(spacing: 0) {
@ -120,11 +128,6 @@ struct ContentView: View {
if let damus = self.damus_state {
TimelineView(events: $home.events, loading: $home.loading, damus: damus, show_friend_icon: false, filter: filter)
}
if privkey != nil {
PostButtonContainer(userSettings: user_settings) {
self.active_sheet = .post
}
}
}
}