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