2021-06-26 23:29:55 +00:00
|
|
|
import Defaults
|
2021-06-23 22:19:58 +00:00
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
struct VideosListView: View {
|
|
|
|
var videos: [Video]
|
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
Section {
|
|
|
|
List {
|
|
|
|
ForEach(videos) { video in
|
2021-07-27 22:40:04 +00:00
|
|
|
VideoView(video: video, layout: .list)
|
2021-06-28 15:27:53 +00:00
|
|
|
.contextMenu { VideoContextMenuView(video: video) }
|
2021-07-11 20:52:49 +00:00
|
|
|
#if os(tvOS)
|
2021-06-23 22:19:58 +00:00
|
|
|
.listRowInsets(listRowInsets)
|
2021-07-11 20:52:49 +00:00
|
|
|
|
|
|
|
#elseif os(iOS)
|
|
|
|
.listRowInsets(EdgeInsets(.zero))
|
|
|
|
.listRowSeparator(.hidden)
|
|
|
|
#endif
|
2021-06-23 22:19:58 +00:00
|
|
|
}
|
|
|
|
}
|
2021-07-11 20:52:49 +00:00
|
|
|
#if os(tvOS)
|
|
|
|
.listStyle(GroupedListStyle())
|
|
|
|
#endif
|
2021-06-23 22:19:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var listRowInsets: EdgeInsets {
|
|
|
|
EdgeInsets(top: .zero, leading: .zero, bottom: .zero, trailing: 30)
|
|
|
|
}
|
|
|
|
}
|
2021-07-27 22:40:04 +00:00
|
|
|
|
|
|
|
struct VideosListView_Previews: PreviewProvider {
|
|
|
|
static var previews: some View {
|
|
|
|
VideosListView(videos: Video.allFixtures)
|
|
|
|
}
|
|
|
|
}
|