Improve sharing, add YouTube links

This commit is contained in:
Arkadiusz Fal
2021-11-02 20:40:49 +01:00
parent 0091af683f
commit f49453e871
8 changed files with 114 additions and 55 deletions

View File

@@ -13,6 +13,7 @@ struct VideoDetails: View {
@State private var confirmationShown = false
@State private var presentingAddToPlaylist = false
@State private var presentingShareSheet = false
@State private var shareURL = ""
@State private var currentPage = Page.details
@@ -254,7 +255,8 @@ struct VideoDetails: View {
HStack {
ShareButton(
contentItem: ContentItem(video: video),
presentingShareSheet: $presentingShareSheet
presentingShareSheet: $presentingShareSheet,
shareURL: $shareURL
)
Spacer()
@@ -286,7 +288,6 @@ struct VideoDetails: View {
.help("Add to Playlist...")
}
.buttonStyle(.plain)
.foregroundColor(.blue)
}
}
.frame(maxHeight: 35)
@@ -300,9 +301,7 @@ struct VideoDetails: View {
}
#if os(iOS)
.sheet(isPresented: $presentingShareSheet) {
if let url = accounts.api.shareURL(contentItem) {
ShareSheet(activityItems: [url])
}
ShareSheet(activityItems: [shareURL])
}
#endif
}