yattee/Apple TV/VideosView.swift

23 lines
660 B
Swift
Raw Normal View History

2021-06-11 21:40:35 +00:00
import SwiftUI
struct VideosView: View {
2021-06-26 11:37:24 +00:00
@EnvironmentObject private var profile: Profile
2021-06-11 21:54:00 +00:00
2021-06-11 21:40:35 +00:00
@Binding var tabSelection: TabSelection
var videos: [Video]
2021-06-26 11:37:24 +00:00
@State private var showingViewOptions = false
2021-06-11 21:40:35 +00:00
var body: some View {
2021-06-26 11:37:24 +00:00
Section {
if self.profile.listing == .list {
2021-06-23 22:19:58 +00:00
VideosListView(tabSelection: $tabSelection, videos: videos)
} else {
2021-06-26 11:37:24 +00:00
VideosCellsView(videos: videos, columns: self.profile.cellsColumns)
2021-06-11 21:40:35 +00:00
}
}
2021-06-26 11:37:24 +00:00
.fullScreenCover(isPresented: $showingViewOptions) { ViewOptionsView() }
.onPlayPauseCommand { showingViewOptions.toggle() }
2021-06-11 21:40:35 +00:00
}
}