mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
New video details
This commit is contained in:
@@ -137,20 +137,32 @@ struct ControlsBar: View {
|
||||
var details: some View {
|
||||
HStack {
|
||||
HStack(spacing: 8) {
|
||||
ZStack(alignment: .bottomTrailing) {
|
||||
authorAvatar
|
||||
Button {
|
||||
if let video = model.currentVideo, !video.isLocal {
|
||||
NavigationModel.openChannel(
|
||||
video.channel,
|
||||
player: model,
|
||||
recents: recents,
|
||||
navigation: navigation,
|
||||
navigationStyle: navigationStyle
|
||||
)
|
||||
}
|
||||
} label: {
|
||||
ZStack(alignment: .bottomTrailing) {
|
||||
authorAvatar
|
||||
|
||||
if accounts.app.supportsSubscriptions,
|
||||
accounts.signedIn,
|
||||
let video = model.currentVideo,
|
||||
subscriptions.isSubscribing(video.channel.id)
|
||||
{
|
||||
Image(systemName: "star.circle.fill")
|
||||
#if !os(tvOS)
|
||||
.background(Color.background)
|
||||
#endif
|
||||
.clipShape(Circle())
|
||||
.foregroundColor(.secondary)
|
||||
if accounts.app.supportsSubscriptions,
|
||||
accounts.signedIn,
|
||||
let video = model.currentVideo,
|
||||
subscriptions.isSubscribing(video.channel.id)
|
||||
{
|
||||
Image(systemName: "star.circle.fill")
|
||||
#if !os(tvOS)
|
||||
.background(Color.background)
|
||||
#endif
|
||||
.clipShape(Circle())
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
}
|
||||
}
|
||||
.contextMenu {
|
||||
|
@@ -1,14 +1,22 @@
|
||||
import SwiftUI
|
||||
|
||||
struct ShareButton: View {
|
||||
struct ShareButton<LabelView: View>: View {
|
||||
let contentItem: ContentItem
|
||||
|
||||
@EnvironmentObject<AccountsModel> private var accounts
|
||||
@EnvironmentObject<NavigationModel> private var navigation
|
||||
@EnvironmentObject<PlayerModel> private var player
|
||||
|
||||
init(contentItem: ContentItem) {
|
||||
let label: LabelView?
|
||||
|
||||
init(
|
||||
contentItem: ContentItem,
|
||||
@ViewBuilder label: @escaping () -> LabelView? = {
|
||||
Label("Share...", systemImage: "square.and.arrow.up")
|
||||
}
|
||||
) {
|
||||
self.contentItem = contentItem
|
||||
self.label = label()
|
||||
}
|
||||
|
||||
@ViewBuilder var body: some View {
|
||||
@@ -24,11 +32,11 @@ struct ShareButton: View {
|
||||
}
|
||||
}
|
||||
} label: {
|
||||
Label("Share...", systemImage: "square.and.arrow.up")
|
||||
label
|
||||
}
|
||||
.menuStyle(.borderlessButton)
|
||||
#if os(macOS)
|
||||
.frame(maxWidth: 35)
|
||||
.frame(maxWidth: 60)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@@ -90,7 +90,10 @@ struct VideoContextMenuView: View {
|
||||
}
|
||||
|
||||
#if os(iOS)
|
||||
if video.isLocal, let url = video.localStream?.localURL, DocumentsModel.shared.isDocument(url) {
|
||||
if video.isLocal,
|
||||
let url = video.localStream?.localURL,
|
||||
DocumentsModel.shared.isDocument(url)
|
||||
{
|
||||
Section {
|
||||
removeDocumentButton
|
||||
}
|
||||
|
Reference in New Issue
Block a user