2021-06-27 04:59:55 +05:30
|
|
|
import Defaults
|
2021-06-12 03:10:35 +05:30
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
struct VideosView: View {
|
2021-06-26 17:07:24 +05:30
|
|
|
@EnvironmentObject private var profile: Profile
|
2021-06-12 03:24:00 +05:30
|
|
|
|
2021-06-12 03:10:35 +05:30
|
|
|
var videos: [Video]
|
|
|
|
|
2021-06-27 04:59:55 +05:30
|
|
|
@Default(.layout) var layout
|
|
|
|
@Default(.tabSelection) var tabSelection
|
|
|
|
|
2021-06-26 17:07:24 +05:30
|
|
|
@State private var showingViewOptions = false
|
|
|
|
|
2021-06-12 03:10:35 +05:30
|
|
|
var body: some View {
|
2021-06-26 17:07:24 +05:30
|
|
|
Section {
|
2021-06-27 04:59:55 +05:30
|
|
|
if layout == .list {
|
|
|
|
VideosListView(videos: videos)
|
2021-06-24 03:49:58 +05:30
|
|
|
} else {
|
2021-06-26 17:07:24 +05:30
|
|
|
VideosCellsView(videos: videos, columns: self.profile.cellsColumns)
|
2021-06-12 03:10:35 +05:30
|
|
|
}
|
|
|
|
}
|
2021-06-26 17:07:24 +05:30
|
|
|
.fullScreenCover(isPresented: $showingViewOptions) { ViewOptionsView() }
|
|
|
|
.onPlayPauseCommand { showingViewOptions.toggle() }
|
2021-06-12 03:10:35 +05:30
|
|
|
}
|
|
|
|
}
|