Navigation model improvements

This commit is contained in:
Arkadiusz Fal
2021-09-29 01:01:49 +02:00
parent d061664570
commit bd813e6771
10 changed files with 113 additions and 149 deletions

View File

@@ -5,12 +5,10 @@ struct AppSidebarSubscriptions: View {
@EnvironmentObject<NavigationModel> private var navigation
@EnvironmentObject<SubscriptionsModel> private var subscriptions
@Binding var selection: TabSelection?
var body: some View {
Section(header: Text("Subscriptions")) {
ForEach(subscriptions.all) { channel in
NavigationLink(tag: TabSelection.channel(channel.id), selection: $selection) {
NavigationLink(tag: TabSelection.channel(channel.id), selection: $navigation.tabSelection) {
LazyView(ChannelVideosView(channel: channel))
} label: {
Label(channel.name, systemImage: AppSidebarNavigation.symbolSystemImage(channel.name))
@@ -21,6 +19,7 @@ struct AppSidebarSubscriptions: View {
}
}
.modifier(UnsubscribeAlertModifier())
.id("channel\(channel.id)")
}
}
.onAppear {