mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
Fix TV navigation
This commit is contained in:
parent
ebbc4876e2
commit
ac813490fe
@ -9,49 +9,47 @@ struct TVNavigationView: View {
|
||||
@Default(.showingAddToPlaylist) var showingAddToPlaylist
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
TabView(selection: $navigationState.tabSelection) {
|
||||
SubscriptionsView()
|
||||
.tabItem { Text("Subscriptions") }
|
||||
.tag(TabSelection.subscriptions)
|
||||
TabView(selection: $navigationState.tabSelection) {
|
||||
SubscriptionsView()
|
||||
.tabItem { Text("Subscriptions") }
|
||||
.tag(TabSelection.subscriptions)
|
||||
|
||||
PopularView()
|
||||
.tabItem { Text("Popular") }
|
||||
.tag(TabSelection.popular)
|
||||
PopularView()
|
||||
.tabItem { Text("Popular") }
|
||||
.tag(TabSelection.popular)
|
||||
|
||||
TrendingView()
|
||||
.tabItem { Text("Trending") }
|
||||
.tag(TabSelection.trending)
|
||||
TrendingView()
|
||||
.tabItem { Text("Trending") }
|
||||
.tag(TabSelection.trending)
|
||||
|
||||
PlaylistsView()
|
||||
.tabItem { Text("Playlists") }
|
||||
.tag(TabSelection.playlists)
|
||||
PlaylistsView()
|
||||
.tabItem { Text("Playlists") }
|
||||
.tag(TabSelection.playlists)
|
||||
|
||||
SearchView()
|
||||
.tabItem { Image(systemName: "magnifyingglass") }
|
||||
.tag(TabSelection.search)
|
||||
}
|
||||
.fullScreenCover(isPresented: $showingOptions) { OptionsView() }
|
||||
.fullScreenCover(isPresented: $showingAddToPlaylist) { AddToPlaylistView() }
|
||||
.fullScreenCover(isPresented: $navigationState.showingVideoDetails) {
|
||||
if let video = navigationState.video {
|
||||
VideoDetailsView(video)
|
||||
}
|
||||
}
|
||||
.fullScreenCover(isPresented: $navigationState.showingChannel, onDismiss: {
|
||||
navigationState.showVideoDetailsIfNeeded()
|
||||
}) {
|
||||
if let channel = navigationState.channel {
|
||||
ChannelView(id: channel.id)
|
||||
}
|
||||
}
|
||||
.fullScreenCover(isPresented: $navigationState.showingVideo) {
|
||||
if let video = navigationState.video {
|
||||
VideoPlayerView(video)
|
||||
}
|
||||
}
|
||||
.onPlayPauseCommand { showingOptions.toggle() }
|
||||
SearchView()
|
||||
.tabItem { Image(systemName: "magnifyingglass") }
|
||||
.tag(TabSelection.search)
|
||||
}
|
||||
.fullScreenCover(isPresented: $showingOptions) { OptionsView() }
|
||||
.fullScreenCover(isPresented: $showingAddToPlaylist) { AddToPlaylistView() }
|
||||
.fullScreenCover(isPresented: $navigationState.showingVideoDetails) {
|
||||
if let video = navigationState.video {
|
||||
VideoDetailsView(video)
|
||||
}
|
||||
}
|
||||
.fullScreenCover(isPresented: $navigationState.showingChannel, onDismiss: {
|
||||
navigationState.showVideoDetailsIfNeeded()
|
||||
}) {
|
||||
if let channel = navigationState.channel {
|
||||
ChannelView(id: channel.id)
|
||||
}
|
||||
}
|
||||
.fullScreenCover(isPresented: $navigationState.showingVideo) {
|
||||
if let video = navigationState.video {
|
||||
VideoPlayerView(video)
|
||||
}
|
||||
}
|
||||
.onPlayPauseCommand { showingOptions.toggle() }
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user