mirror of
https://github.com/yattee/yattee.git
synced 2025-01-08 22:07:10 +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
|
@Default(.showingAddToPlaylist) var showingAddToPlaylist
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationView {
|
TabView(selection: $navigationState.tabSelection) {
|
||||||
TabView(selection: $navigationState.tabSelection) {
|
SubscriptionsView()
|
||||||
SubscriptionsView()
|
.tabItem { Text("Subscriptions") }
|
||||||
.tabItem { Text("Subscriptions") }
|
.tag(TabSelection.subscriptions)
|
||||||
.tag(TabSelection.subscriptions)
|
|
||||||
|
|
||||||
PopularView()
|
PopularView()
|
||||||
.tabItem { Text("Popular") }
|
.tabItem { Text("Popular") }
|
||||||
.tag(TabSelection.popular)
|
.tag(TabSelection.popular)
|
||||||
|
|
||||||
TrendingView()
|
TrendingView()
|
||||||
.tabItem { Text("Trending") }
|
.tabItem { Text("Trending") }
|
||||||
.tag(TabSelection.trending)
|
.tag(TabSelection.trending)
|
||||||
|
|
||||||
PlaylistsView()
|
PlaylistsView()
|
||||||
.tabItem { Text("Playlists") }
|
.tabItem { Text("Playlists") }
|
||||||
.tag(TabSelection.playlists)
|
.tag(TabSelection.playlists)
|
||||||
|
|
||||||
SearchView()
|
SearchView()
|
||||||
.tabItem { Image(systemName: "magnifyingglass") }
|
.tabItem { Image(systemName: "magnifyingglass") }
|
||||||
.tag(TabSelection.search)
|
.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() }
|
|
||||||
}
|
}
|
||||||
|
.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