mirror of
https://github.com/yattee/yattee.git
synced 2024-11-09 15:58:20 +00:00
Use lazy views in TV navigation
This commit is contained in:
parent
179455bbc0
commit
07b6649f26
@ -14,44 +14,44 @@ struct TVNavigationView: View {
|
||||
NavigationView {
|
||||
TabView(selection: navigation.tabSelectionBinding) {
|
||||
if visibleSections.contains(.favorites) {
|
||||
FavoritesView()
|
||||
LazyView(FavoritesView())
|
||||
.tabItem { Text("Favorites") }
|
||||
.tag(TabSelection.favorites)
|
||||
}
|
||||
|
||||
if visibleSections.contains(.subscriptions), accounts.app.supportsSubscriptions, accounts.api.signedIn {
|
||||
SubscriptionsView()
|
||||
LazyView(SubscriptionsView())
|
||||
.tabItem { Text("Subscriptions") }
|
||||
.tag(TabSelection.subscriptions)
|
||||
}
|
||||
|
||||
if visibleSections.contains(.popular), accounts.app.supportsPopular {
|
||||
PopularView()
|
||||
LazyView(PopularView())
|
||||
.tabItem { Text("Popular") }
|
||||
.tag(TabSelection.popular)
|
||||
}
|
||||
|
||||
if visibleSections.contains(.trending) {
|
||||
TrendingView()
|
||||
LazyView(TrendingView())
|
||||
.tabItem { Text("Trending") }
|
||||
.tag(TabSelection.trending)
|
||||
}
|
||||
|
||||
if visibleSections.contains(.playlists), accounts.app.supportsUserPlaylists, accounts.signedIn {
|
||||
PlaylistsView()
|
||||
LazyView(PlaylistsView())
|
||||
.tabItem { Text("Playlists") }
|
||||
.tag(TabSelection.playlists)
|
||||
}
|
||||
|
||||
NowPlayingView()
|
||||
LazyView(NowPlayingView())
|
||||
.tabItem { Text("Now Playing") }
|
||||
.tag(TabSelection.nowPlaying)
|
||||
|
||||
SearchView()
|
||||
LazyView(SearchView())
|
||||
.tabItem { Image(systemName: "magnifyingglass") }
|
||||
.tag(TabSelection.search)
|
||||
|
||||
SettingsView()
|
||||
LazyView(SettingsView())
|
||||
.tabItem { Image(systemName: "gear") }
|
||||
.tag(TabSelection.settings)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user