2021-06-27 04:59:55 +05:30
|
|
|
import Defaults
|
2021-06-12 03:10:35 +05:30
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
struct VideosView: View {
|
2021-07-19 04:02:46 +05:30
|
|
|
@EnvironmentObject<NavigationState> private var navigationState
|
|
|
|
|
2021-06-28 20:57:53 +05:30
|
|
|
@State private var profile = Profile()
|
2021-07-08 04:31:54 +05:30
|
|
|
|
2021-07-19 04:02:46 +05:30
|
|
|
#if os(tvOS)
|
2021-08-02 04:31:24 +05:30
|
|
|
@Default(.layout) private var layout
|
2021-07-12 02:22:49 +05:30
|
|
|
#endif
|
|
|
|
|
2021-07-08 04:09:18 +05:30
|
|
|
var videos: [Video]
|
2021-07-08 04:31:54 +05:30
|
|
|
|
2021-06-12 03:10:35 +05:30
|
|
|
var body: some View {
|
2021-07-09 20:23:53 +05:30
|
|
|
VStack {
|
2021-07-12 02:22:49 +05:30
|
|
|
#if os(tvOS)
|
|
|
|
if layout == .cells {
|
2021-08-02 04:31:24 +05:30
|
|
|
VideosCellsView(videos: videos)
|
2021-07-12 02:22:49 +05:30
|
|
|
} else {
|
|
|
|
VideosListView(videos: videos)
|
|
|
|
}
|
|
|
|
#else
|
2021-08-02 04:31:24 +05:30
|
|
|
VideosCellsView(videos: videos)
|
2021-07-12 02:22:49 +05:30
|
|
|
#endif
|
2021-07-09 20:23:53 +05:30
|
|
|
}
|
2021-08-03 02:40:22 +05:30
|
|
|
#if os(macOS)
|
|
|
|
.background()
|
2021-08-03 04:13:47 +05:30
|
|
|
.frame(minWidth: 360)
|
2021-08-03 02:40:22 +05:30
|
|
|
#endif
|
2021-06-12 03:10:35 +05:30
|
|
|
}
|
|
|
|
}
|