mirror of
https://github.com/yattee/yattee.git
synced 2024-11-10 00:08:21 +00:00
32 lines
1.1 KiB
Swift
32 lines
1.1 KiB
Swift
import Defaults
|
|
import SwiftUI
|
|
|
|
struct AppSidebarSubscriptions: View {
|
|
@ObservedObject private var navigation = NavigationModel.shared
|
|
@ObservedObject private var subscriptions = SubscribedChannelsModel.shared
|
|
|
|
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).modifier(PlayerOverlayModifier()))
|
|
} label: {
|
|
Label(channel.name, systemImage: RecentsModel.symbolSystemImage(channel.name))
|
|
}
|
|
.contextMenu {
|
|
Button("Unsubscribe") {
|
|
navigation.presentUnsubscribeAlert(channel, subscriptions: subscriptions)
|
|
}
|
|
}
|
|
.id("channel\(channel.id)")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
struct AppSidebarSubscriptions_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
AppSidebarSubscriptions()
|
|
}
|
|
}
|