mirror of
https://github.com/yattee/yattee.git
synced 2024-12-14 22:30:32 +05:30
40 lines
981 B
Swift
40 lines
981 B
Swift
import Defaults
|
|
import SwiftUI
|
|
|
|
struct VideosView: View {
|
|
@State private var profile = Profile()
|
|
|
|
@Default(.layout) var layout
|
|
|
|
@Default(.showingAddToPlaylist) var showingAddToPlaylist
|
|
|
|
#if os(iOS)
|
|
@Environment(\.verticalSizeClass) private var horizontalSizeClass
|
|
#endif
|
|
|
|
var videos: [Video]
|
|
|
|
var body: some View {
|
|
VStack {
|
|
#if os(tvOS)
|
|
if layout == .cells {
|
|
VideosCellsView(videos: videos, columns: self.profile.cellsColumns)
|
|
} else {
|
|
VideosListView(videos: videos)
|
|
}
|
|
#else
|
|
VideosListView(videos: videos)
|
|
#if os(macOS)
|
|
.frame(minWidth: 250, idealWidth: 350)
|
|
#endif
|
|
#endif
|
|
}
|
|
|
|
#if os(tvOS)
|
|
.fullScreenCover(isPresented: $showingAddToPlaylist) {
|
|
AddToPlaylistView()
|
|
}
|
|
#endif
|
|
}
|
|
}
|