mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-22 00:01:00 +00:00
Remove items from secondary navigation when browsing
This commit is contained in:
parent
b0132640ab
commit
15cc811102
1 changed files with 28 additions and 26 deletions
|
@ -29,35 +29,37 @@ struct SecondaryNavigationView: View {
|
|||
Label("secondary-navigation.accounts", systemImage: "rectangle.stack.person.crop")
|
||||
}
|
||||
}
|
||||
Section {
|
||||
NavigationLink(destination: ListsView(viewModel: .init(identityContext: viewModel.identityContext))
|
||||
.environmentObject(rootViewModel)) {
|
||||
Label("secondary-navigation.lists", systemImage: "scroll")
|
||||
}
|
||||
ForEach([Timeline.favorites, Timeline.bookmarks]) { timeline in
|
||||
Button {
|
||||
viewModel.navigate(timeline: timeline)
|
||||
} label: {
|
||||
Label {
|
||||
Text(timeline.title).foregroundColor(.primary)
|
||||
} icon: {
|
||||
Image(systemName: timeline.systemImageName)
|
||||
if viewModel.identityContext.identity.authenticated && !viewModel.identityContext.identity.pending {
|
||||
Section {
|
||||
NavigationLink(destination: ListsView(viewModel: .init(identityContext: viewModel.identityContext))
|
||||
.environmentObject(rootViewModel)) {
|
||||
Label("secondary-navigation.lists", systemImage: "scroll")
|
||||
}
|
||||
ForEach([Timeline.favorites, Timeline.bookmarks]) { timeline in
|
||||
Button {
|
||||
viewModel.navigate(timeline: timeline)
|
||||
} label: {
|
||||
Label {
|
||||
Text(timeline.title).foregroundColor(.primary)
|
||||
} icon: {
|
||||
Image(systemName: timeline.systemImageName)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if let followRequestCount = viewModel.identityContext.identity.account?.followRequestCount,
|
||||
followRequestCount > 0 {
|
||||
Button {
|
||||
viewModel.navigateToFollowerRequests()
|
||||
} label: {
|
||||
Label {
|
||||
HStack {
|
||||
Text("follow-requests").foregroundColor(.primary)
|
||||
Spacer()
|
||||
Text(verbatim: String(followRequestCount))
|
||||
if let followRequestCount = viewModel.identityContext.identity.account?.followRequestCount,
|
||||
followRequestCount > 0 {
|
||||
Button {
|
||||
viewModel.navigateToFollowerRequests()
|
||||
} label: {
|
||||
Label {
|
||||
HStack {
|
||||
Text("follow-requests").foregroundColor(.primary)
|
||||
Spacer()
|
||||
Text(verbatim: String(followRequestCount))
|
||||
}
|
||||
} icon: {
|
||||
Image(systemName: "person.badge.plus")
|
||||
}
|
||||
} icon: {
|
||||
Image(systemName: "person.badge.plus")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue