mirror of
https://github.com/yattee/yattee.git
synced 2024-12-13 22:00:31 +05:30
26 lines
917 B
Swift
26 lines
917 B
Swift
import Defaults
|
|
import SwiftUI
|
|
|
|
struct AppSidebarSubscriptions: View {
|
|
@EnvironmentObject<NavigationModel> private var navigation
|
|
@EnvironmentObject<SubscriptionsModel> private var subscriptions
|
|
|
|
var body: some View {
|
|
Section(header: Text("Subscriptions")) {
|
|
ForEach(subscriptions.all) { channel in
|
|
NavigationLink(tag: TabSelection.channel(channel.id), selection: $navigation.tabSelection) {
|
|
LazyView(ChannelVideosView(channel: channel))
|
|
} label: {
|
|
Label(channel.name, systemImage: AppSidebarNavigation.symbolSystemImage(channel.name))
|
|
}
|
|
.contextMenu {
|
|
Button("Unsubscribe") {
|
|
navigation.presentUnsubscribeAlert(channel)
|
|
}
|
|
}
|
|
.id("channel\(channel.id)")
|
|
}
|
|
}
|
|
}
|
|
}
|