mirror of
https://github.com/yattee/yattee.git
synced 2026-05-14 11:25:02 +00:00
Add Playlists entry to sidebar main navigation
Adds a toggleable "Playlists" item that opens PlaylistsListView, mirroring the Channels → ManageChannelsView pattern.
This commit is contained in:
@@ -33,6 +33,7 @@ struct UnifiedTabView: View {
|
||||
@State private var downloadsPath = NavigationPath()
|
||||
@State private var subscriptionsFeedPath = NavigationPath()
|
||||
@State private var manageChannelsPath = NavigationPath()
|
||||
@State private var playlistsListPath = NavigationPath()
|
||||
@State private var sourcesPath = NavigationPath()
|
||||
@State private var settingsPath = NavigationPath()
|
||||
@State private var openURLPath = NavigationPath()
|
||||
@@ -182,6 +183,16 @@ struct UnifiedTabView: View {
|
||||
Label(SidebarItem.manageChannels.title, systemImage: SidebarItem.manageChannels.systemImage)
|
||||
}
|
||||
|
||||
case .playlists:
|
||||
Tab(value: SidebarItem.playlistsList) {
|
||||
NavigationStack(path: $playlistsListPath) {
|
||||
PlaylistsListView()
|
||||
.withNavigationDestinations()
|
||||
}
|
||||
} label: {
|
||||
Label(SidebarItem.playlistsList.title, systemImage: SidebarItem.playlistsList.systemImage)
|
||||
}
|
||||
|
||||
case .sources:
|
||||
Tab(value: SidebarItem.sources) {
|
||||
NavigationStack(path: $sourcesPath) {
|
||||
@@ -340,6 +351,7 @@ struct UnifiedTabView: View {
|
||||
@State private var downloadsPath = NavigationPath()
|
||||
@State private var subscriptionsFeedPath = NavigationPath()
|
||||
@State private var manageChannelsPath = NavigationPath()
|
||||
@State private var playlistsListPath = NavigationPath()
|
||||
@State private var sourcesPath = NavigationPath()
|
||||
@State private var settingsPath = NavigationPath()
|
||||
@State private var openURLPath = NavigationPath()
|
||||
@@ -471,6 +483,15 @@ struct UnifiedTabView: View {
|
||||
Label(SidebarItem.manageChannels.title, systemImage: SidebarItem.manageChannels.systemImage)
|
||||
}
|
||||
|
||||
case .playlists:
|
||||
Tab(value: SidebarItem.playlistsList) {
|
||||
NavigationStack(path: $playlistsListPath) {
|
||||
PlaylistsListView().withNavigationDestinations()
|
||||
}
|
||||
} label: {
|
||||
Label(SidebarItem.playlistsList.title, systemImage: SidebarItem.playlistsList.systemImage)
|
||||
}
|
||||
|
||||
case .sources:
|
||||
Tab(value: SidebarItem.sources) {
|
||||
NavigationStack(path: $sourcesPath) {
|
||||
@@ -582,6 +603,7 @@ struct UnifiedTabView: View {
|
||||
@State private var historyPath = NavigationPath()
|
||||
@State private var subscriptionsFeedPath = NavigationPath()
|
||||
@State private var manageChannelsPath = NavigationPath()
|
||||
@State private var playlistsListPath = NavigationPath()
|
||||
@State private var sourcesPath = NavigationPath()
|
||||
@State private var settingsPath = NavigationPath()
|
||||
@State private var openURLPath = NavigationPath()
|
||||
@@ -730,6 +752,16 @@ struct UnifiedTabView: View {
|
||||
Label(SidebarItem.manageChannels.title, systemImage: SidebarItem.manageChannels.systemImage)
|
||||
}
|
||||
|
||||
case .playlists:
|
||||
Tab(value: SidebarItem.playlistsList) {
|
||||
NavigationStack(path: $playlistsListPath) {
|
||||
PlaylistsListView()
|
||||
.withNavigationDestinations()
|
||||
}
|
||||
} label: {
|
||||
Label(SidebarItem.playlistsList.title, systemImage: SidebarItem.playlistsList.systemImage)
|
||||
}
|
||||
|
||||
case .sources:
|
||||
Tab(value: SidebarItem.sources) {
|
||||
NavigationStack(path: $sourcesPath) {
|
||||
@@ -886,6 +918,8 @@ extension UnifiedTabView {
|
||||
subscriptionsFeedPath.append(destination)
|
||||
case .manageChannels:
|
||||
manageChannelsPath.append(destination)
|
||||
case .playlistsList:
|
||||
playlistsListPath.append(destination)
|
||||
case .sources:
|
||||
sourcesPath.append(destination)
|
||||
case .settings:
|
||||
|
||||
Reference in New Issue
Block a user