yattee/Shared/Videos/VideosView.swift

31 lines
686 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 {
2021-07-18 22:32:46 +00:00
@EnvironmentObject<NavigationState> private var navigationState
#if os(tvOS)
2021-08-01 23:01:24 +00:00
@Default(.layout) private var layout
2021-07-11 20:52:49 +00:00
#endif
2021-07-07 22:39:18 +00:00
var videos: [Video]
2021-07-07 23:01:54 +00:00
2021-06-11 21:40:35 +00:00
var body: some View {
VStack {
2021-07-11 20:52:49 +00:00
#if os(tvOS)
if layout == .cells {
2021-09-18 20:36:42 +00:00
VideosCellsVertical(videos: videos)
2021-07-11 20:52:49 +00:00
} else {
VideosListView(videos: videos)
}
#else
2021-09-18 20:36:42 +00:00
VideosCellsVertical(videos: videos)
2021-07-11 20:52:49 +00:00
#endif
}
2021-08-02 21:10:22 +00:00
#if os(macOS)
.background()
2021-08-02 22:43:47 +00:00
.frame(minWidth: 360)
2021-08-02 21:10:22 +00:00
#endif
2021-06-11 21:40:35 +00:00
}
}