mirror of
https://github.com/yattee/yattee.git
synced 2025-08-06 10:44:06 +00:00
Settings for iOS/macOS
This commit is contained in:
@@ -2,17 +2,17 @@ import Defaults
|
||||
import SwiftUI
|
||||
|
||||
struct TVNavigationView: View {
|
||||
@EnvironmentObject<NavigationState> private var navigationState
|
||||
@EnvironmentObject<PlaybackState> private var playbackState
|
||||
@EnvironmentObject<NavigationModel> private var navigation
|
||||
@EnvironmentObject<PlaybackModel> private var playback
|
||||
@EnvironmentObject<Recents> private var recents
|
||||
@EnvironmentObject<SearchState> private var searchState
|
||||
@EnvironmentObject<SearchModel> private var search
|
||||
|
||||
@State private var showingOptions = false
|
||||
|
||||
@Default(.showingAddToPlaylist) var showingAddToPlaylist
|
||||
|
||||
var body: some View {
|
||||
TabView(selection: $navigationState.tabSelection) {
|
||||
TabView(selection: $navigation.tabSelection) {
|
||||
WatchNowView()
|
||||
.tabItem { Text("Watch Now") }
|
||||
.tag(TabSelection.watchNow)
|
||||
@@ -34,30 +34,30 @@ struct TVNavigationView: View {
|
||||
.tag(TabSelection.playlists)
|
||||
|
||||
SearchView()
|
||||
.searchable(text: $searchState.queryText) {
|
||||
ForEach(searchState.querySuggestions.collection, id: \.self) { suggestion in
|
||||
.searchable(text: $search.queryText) {
|
||||
ForEach(search.querySuggestions.collection, id: \.self) { suggestion in
|
||||
Text(suggestion)
|
||||
.searchCompletion(suggestion)
|
||||
}
|
||||
}
|
||||
.onChange(of: searchState.queryText) { newQuery in
|
||||
searchState.loadQuerySuggestions(newQuery)
|
||||
searchState.changeQuery { query in query.query = newQuery }
|
||||
.onChange(of: search.queryText) { newQuery in
|
||||
search.loadSuggestions(newQuery)
|
||||
search.changeQuery { query in query.query = newQuery }
|
||||
}
|
||||
.tabItem { Image(systemName: "magnifyingglass") }
|
||||
.tag(TabSelection.search)
|
||||
}
|
||||
.fullScreenCover(isPresented: $showingOptions) { OptionsView() }
|
||||
.fullScreenCover(isPresented: $showingAddToPlaylist) { AddToPlaylistView() }
|
||||
.fullScreenCover(isPresented: $navigationState.showingVideo) {
|
||||
if let video = navigationState.video {
|
||||
.fullScreenCover(isPresented: $navigation.showingVideo) {
|
||||
if let video = navigation.video {
|
||||
VideoPlayerView(video)
|
||||
.environmentObject(playbackState)
|
||||
.environmentObject(playback)
|
||||
}
|
||||
}
|
||||
.fullScreenCover(isPresented: $navigationState.isChannelOpen) {
|
||||
.fullScreenCover(isPresented: $navigation.isChannelOpen) {
|
||||
if let channel = recents.presentedChannel {
|
||||
ChannelVideosView(channel)
|
||||
ChannelVideosView(channel: channel)
|
||||
.background(.thickMaterial)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user