yattee/Apple TV/VideosView.swift

26 lines
659 B
Swift
Raw Normal View History

2021-06-26 23:29:55 +00:00
import Defaults
2021-06-11 21:40:35 +00:00
import SwiftUI
struct VideosView: View {
@State private var profile = Profile()
2021-06-11 21:54:00 +00:00
2021-06-11 21:40:35 +00:00
var videos: [Video]
2021-06-26 23:29:55 +00:00
@Default(.layout) var layout
@Default(.tabSelection) var tabSelection
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 23:50:32 +00:00
VStack {
if layout == .cells {
2021-06-26 11:37:24 +00:00
VideosCellsView(videos: videos, columns: self.profile.cellsColumns)
2021-06-26 23:50:32 +00:00
} else {
VideosListView(videos: videos)
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
}
}