mirror of
https://github.com/yattee/yattee.git
synced 2026-02-19 09:19:46 +00:00
Add context menu and swipe actions to related videos in VideoInfoView
This commit is contained in:
@@ -1441,21 +1441,18 @@ struct VideoInfoView: View {
|
|||||||
CollapsibleSection(title: String(localized: "videoInfo.section.relatedVideos"), isExpanded: $isRelatedExpanded) {
|
CollapsibleSection(title: String(localized: "videoInfo.section.relatedVideos"), isExpanded: $isRelatedExpanded) {
|
||||||
LazyVStack(spacing: 12) {
|
LazyVStack(spacing: 12) {
|
||||||
ForEach(Array(videos.enumerated()), id: \.element.id) { index, relatedVideo in
|
ForEach(Array(videos.enumerated()), id: \.element.id) { index, relatedVideo in
|
||||||
Button {
|
VideoRowView(video: relatedVideo, style: .regular)
|
||||||
let queueContext = VideoQueueContext(
|
.tappableVideo(
|
||||||
video: relatedVideo,
|
relatedVideo,
|
||||||
queueSource: .manual,
|
queueSource: .manual,
|
||||||
sourceLabel: String(localized: "videoInfo.section.relatedVideos"),
|
sourceLabel: String(localized: "videoInfo.section.relatedVideos"),
|
||||||
videoList: videos,
|
videoList: videos,
|
||||||
videoIndex: index,
|
videoIndex: index,
|
||||||
startTime: nil,
|
|
||||||
loadMoreVideos: nil
|
loadMoreVideos: nil
|
||||||
)
|
)
|
||||||
navigationCoordinator?.navigate(to: .video(.loaded(relatedVideo), queueContext: queueContext))
|
#if !os(tvOS)
|
||||||
} label: {
|
.videoSwipeActions(video: relatedVideo)
|
||||||
VideoRowView(video: relatedVideo, style: .regular, disableInternalTapHandling: true)
|
#endif
|
||||||
}
|
|
||||||
.buttonStyle(.plain)
|
|
||||||
|
|
||||||
if index < videos.count - 1 {
|
if index < videos.count - 1 {
|
||||||
Divider()
|
Divider()
|
||||||
|
|||||||
Reference in New Issue
Block a user