mirror of
https://github.com/yattee/yattee.git
synced 2025-08-05 02:04:07 +00:00
Subscribed channels list in tab navigation
This commit is contained in:
@@ -3,7 +3,7 @@ import SwiftUI
|
||||
|
||||
struct AppSidebarSubscriptions: View {
|
||||
@ObservedObject private var navigation = NavigationModel.shared
|
||||
@ObservedObject private var subscriptions = SubscriptionsModel.shared
|
||||
@ObservedObject private var subscriptions = SubsribedChannelsModel.shared
|
||||
|
||||
var body: some View {
|
||||
Section(header: Text("Subscriptions")) {
|
||||
@@ -23,3 +23,9 @@ struct AppSidebarSubscriptions: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct AppSidebarSubscriptions_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
AppSidebarSubscriptions()
|
||||
}
|
||||
}
|
||||
|
@@ -5,7 +5,7 @@ struct AppTabNavigation: View {
|
||||
@ObservedObject private var accounts = AccountsModel.shared
|
||||
@ObservedObject private var navigation = NavigationModel.shared
|
||||
private var player = PlayerModel.shared
|
||||
@ObservedObject private var subscriptions = SubscriptionsModel.shared
|
||||
@ObservedObject private var subscriptions = SubsribedChannelsModel.shared
|
||||
|
||||
@Default(.showHome) private var showHome
|
||||
@Default(.showDocuments) private var showDocuments
|
||||
@@ -170,23 +170,27 @@ struct AppTabNavigation: View {
|
||||
|
||||
@ViewBuilder private var channelView: some View {
|
||||
if navigation.presentingChannel {
|
||||
ChannelVideosView()
|
||||
.environment(\.managedObjectContext, persistenceController.container.viewContext)
|
||||
.environment(\.inChannelView, true)
|
||||
.environment(\.navigationStyle, .tab)
|
||||
.id("channelVideos")
|
||||
.zIndex(player.presentingPlayer ? -1 : 2)
|
||||
.transition(.move(edge: .bottom))
|
||||
NavigationView {
|
||||
ChannelVideosView(showCloseButton: true)
|
||||
}
|
||||
.environment(\.managedObjectContext, persistenceController.container.viewContext)
|
||||
.environment(\.inChannelView, true)
|
||||
.environment(\.navigationStyle, .tab)
|
||||
.id("channelVideos")
|
||||
.zIndex(player.presentingPlayer ? -1 : 2)
|
||||
.transition(.move(edge: .bottom))
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder private var playlistView: some View {
|
||||
if navigation.presentingPlaylist {
|
||||
ChannelPlaylistView()
|
||||
.environment(\.managedObjectContext, persistenceController.container.viewContext)
|
||||
.id("channelPlaylist")
|
||||
.zIndex(player.presentingPlayer ? -1 : 1)
|
||||
.transition(.move(edge: .bottom))
|
||||
NavigationView {
|
||||
ChannelPlaylistView(showCloseButton: true)
|
||||
}
|
||||
.environment(\.managedObjectContext, persistenceController.container.viewContext)
|
||||
.id("channelPlaylist")
|
||||
.zIndex(player.presentingPlayer ? -1 : 1)
|
||||
.transition(.move(edge: .bottom))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@ struct ContentView: View {
|
||||
@ObservedObject private var navigation = NavigationModel.shared
|
||||
@ObservedObject private var player = PlayerModel.shared
|
||||
private var playlists = PlaylistsModel.shared
|
||||
private var subscriptions = SubscriptionsModel.shared
|
||||
private var subscriptions = SubsribedChannelsModel.shared
|
||||
|
||||
#if os(iOS)
|
||||
@Environment(\.horizontalSizeClass) private var horizontalSizeClass
|
||||
|
Reference in New Issue
Block a user