damus

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

commit 98c7bf5afc8e8e6621566705f6e18df5dc3879a8
parent 70a7239cfd90b10006df1cb052b15986dd45ec56
Author: William Casarin <jb55@jb55.com>
Date:   Mon, 13 Feb 2023 16:51:13 -0800

Revert "Sidebar Fixes"

This reverts commit 6653798d275da4d8945b8f41c7d55371278e181d.

Diffstat:
Mdamus/ContentView.swift | 81+++++++++++++++++++++++++++++++++++++------------------------------------------
Mdamus/Views/SideMenuView.swift | 9++-------
2 files changed, 40 insertions(+), 50 deletions(-)

diff --git a/damus/ContentView.swift b/damus/ContentView.swift @@ -260,67 +260,62 @@ struct ContentView: View { } var body: some View { - ZStack() { + VStack(alignment: .leading, spacing: 0) { if let damus = self.damus_state { NavigationView { - VStack(alignment: .leading, spacing: 0) { - ZStack { - TabView { // Prevents navbar appearance change on scroll - MainContent(damus: damus) - .toolbar() { - ToolbarItem(placement: .navigationBarLeading) { - Button { - isSideBarOpened.toggle() - } label: { - ProfilePicView(pubkey: damus_state!.pubkey, size: 32, highlight: .none, profiles: damus_state!.profiles) - .opacity(isSideBarOpened ? 0 : 1) - .animation(isSideBarOpened ? .none : .default, value: isSideBarOpened) - } - .disabled(isSideBarOpened) + ZStack { + TabView { // Prevents navbar appearance change on scroll + MainContent(damus: damus) + .toolbar() { + ToolbarItem(placement: .navigationBarLeading) { + Button { + isSideBarOpened.toggle() + } label: { + ProfilePicView(pubkey: damus_state!.pubkey, size: 32, highlight: .none, profiles: damus_state!.profiles) + .opacity(isSideBarOpened ? 0 : 1) + .animation(isSideBarOpened ? .none : .default, value: isSideBarOpened) } - - ToolbarItem(placement: .navigationBarTrailing) { - HStack(alignment: .center) { - if home.signal.signal != home.signal.max_signal { - NavigationLink(destination: RelayConfigView(state: damus_state!)) { - Text("\(home.signal.signal)/\(home.signal.max_signal)", comment: "Fraction of how many of the user's relay servers that are operational.") - .font(.callout) - .foregroundColor(.gray) - } + .disabled(isSideBarOpened) + } + + ToolbarItem(placement: .navigationBarTrailing) { + HStack(alignment: .center) { + if home.signal.signal != home.signal.max_signal { + NavigationLink(destination: RelayConfigView(state: damus_state!)) { + Text("\(home.signal.signal)/\(home.signal.max_signal)", comment: "Fraction of how many of the user's relay servers that are operational.") + .font(.callout) + .foregroundColor(.gray) } - - // maybe expand this to other timelines in the future - if selected_timeline == .search { - Button(action: { - //isFilterVisible.toggle() - self.active_sheet = .filter - }) { - // checklist, checklist.checked, lisdt.bullet, list.bullet.circle, line.3.horizontal.decrease..., line.3.horizontail.decrease - Label("Filter", systemImage: "line.3.horizontal.decrease") - .foregroundColor(.gray) + } + + // maybe expand this to other timelines in the future + if selected_timeline == .search { + Button(action: { + //isFilterVisible.toggle() + self.active_sheet = .filter + }) { + // checklist, checklist.checked, lisdt.bullet, list.bullet.circle, line.3.horizontal.decrease..., line.3.horizontail.decrease + Label("Filter", systemImage: "line.3.horizontal.decrease") + .foregroundColor(.gray) //.contentShape(Rectangle()) - } } } } } - } - .tabViewStyle(.page(indexDisplayMode: .never)) + } } - - TabBar(new_events: $home.new_events, selected: $selected_timeline, isSidebarVisible: $isSideBarOpened, action: switch_timeline) - .padding([.bottom], 8) + .tabViewStyle(.page(indexDisplayMode: .never)) } .overlay( SideMenuView(damus_state: damus, isSidebarVisible: $isSideBarOpened.animation()) ) - .navigationBarTitleDisplayMode(.inline) } .navigationViewStyle(.stack) - + + TabBar(new_events: $home.new_events, selected: $selected_timeline, isSidebarVisible: $isSideBarOpened, action: switch_timeline) + .padding([.bottom], 8) } } - .onAppear() { self.connect() setup_notifications() diff --git a/damus/Views/SideMenuView.swift b/damus/Views/SideMenuView.swift @@ -166,13 +166,8 @@ struct SideMenuView: View { @ViewBuilder func navLabel(title: String, systemImage: String) -> some View { - Label { - Text(title) - .font(.title2) - } icon: { - Image(systemName: systemImage) - .frame(width:20) - } + Label(title, systemImage: systemImage) + .font(.title2) .foregroundColor(textColor()) .frame(maxWidth: .infinity, alignment: .leading) }