Minor fixes

This commit is contained in:
Arkadiusz Fal
2022-12-20 23:24:39 +01:00
parent 37d8873424
commit c432aa3b9a
8 changed files with 30 additions and 26 deletions

View File

@@ -123,17 +123,14 @@ struct VideoBanner: View {
#endif
}
.fixedSize(horizontal: false, vertical: true)
.contentShape(Rectangle())
#if os(tvOS)
.buttonStyle(.card)
#else
.padding(.trailing, 10)
#elseif os(macOS)
.buttonStyle(.plain)
#endif
#if os(tvOS)
.padding(.trailing, 10)
#endif
.opacity(contentOpacity)
.id(id ?? video?.videoID ?? video?.id)
.opacity(contentOpacity)
}
private var extraAttributes: some View {

View File

@@ -15,8 +15,6 @@ struct VideoCell: View {
@Environment(\.verticalSizeClass) private var verticalSizeClass
#endif
@ObservedObject private var thumbnails = ThumbnailsModel.shared
@Default(.channelOnThumbnail) private var channelOnThumbnail
@Default(.timeOnThumbnail) private var timeOnThumbnail
@Default(.roundedThumbnails) private var roundedThumbnails
@@ -445,7 +443,7 @@ struct VideoCell: View {
private var thumbnailImage: some View {
Group {
ThumbnailView(url: thumbnails.best(video))
VideoCellThumbnail(video: video)
#if os(tvOS)
.frame(minHeight: 320)
@@ -503,6 +501,15 @@ struct VideoCell: View {
}
}
struct VideoCellThumbnail: View {
let video: Video
@ObservedObject private var thumbnails = ThumbnailsModel.shared
var body: some View {
ThumbnailView(url: thumbnails.best(video))
}
}
struct VideoCell_Preview: PreviewProvider {
static var previews: some View {
Group {