mirror of
https://github.com/yattee/yattee.git
synced 2025-08-06 18:54:11 +00:00
Fix new offenses
This commit is contained in:
@@ -54,33 +54,33 @@ struct ChannelPlaylistView: View {
|
||||
VerticalCells(items: items)
|
||||
}
|
||||
#if os(iOS)
|
||||
.sheet(isPresented: $presentingShareSheet) {
|
||||
if let url = accounts.api.shareURL(contentItem) {
|
||||
ShareSheet(activityItems: [url])
|
||||
}
|
||||
.sheet(isPresented: $presentingShareSheet) {
|
||||
if let url = accounts.api.shareURL(contentItem) {
|
||||
ShareSheet(activityItems: [url])
|
||||
}
|
||||
}
|
||||
#endif
|
||||
.onAppear {
|
||||
resource?.addObserver(store)
|
||||
resource?.loadIfNeeded()
|
||||
}
|
||||
#if !os(tvOS)
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .navigation) {
|
||||
ShareButton(
|
||||
contentItem: contentItem,
|
||||
presentingShareSheet: $presentingShareSheet
|
||||
)
|
||||
}
|
||||
|
||||
ToolbarItem {
|
||||
FavoriteButton(item: FavoriteItem(section: .channelPlaylist(playlist.id, playlist.title)))
|
||||
}
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .navigation) {
|
||||
ShareButton(
|
||||
contentItem: contentItem,
|
||||
presentingShareSheet: $presentingShareSheet
|
||||
)
|
||||
}
|
||||
.navigationTitle(playlist.title)
|
||||
|
||||
ToolbarItem {
|
||||
FavoriteButton(item: FavoriteItem(section: .channelPlaylist(playlist.id, playlist.title)))
|
||||
}
|
||||
}
|
||||
.navigationTitle(playlist.title)
|
||||
|
||||
#else
|
||||
.background(.thickMaterial)
|
||||
.background(.thickMaterial)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@@ -75,44 +75,44 @@ struct ChannelVideosView: View {
|
||||
.focusScope(focusNamespace)
|
||||
#endif
|
||||
#if !os(tvOS)
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .navigation) {
|
||||
ShareButton(
|
||||
contentItem: contentItem,
|
||||
presentingShareSheet: $presentingShareSheet
|
||||
)
|
||||
}
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .navigation) {
|
||||
ShareButton(
|
||||
contentItem: contentItem,
|
||||
presentingShareSheet: $presentingShareSheet
|
||||
)
|
||||
}
|
||||
|
||||
ToolbarItem {
|
||||
HStack {
|
||||
Text("**\(store.item?.subscriptionsString ?? "loading")** subscribers")
|
||||
.foregroundColor(.secondary)
|
||||
.opacity(store.item?.subscriptionsString != nil ? 1 : 0)
|
||||
ToolbarItem {
|
||||
HStack {
|
||||
Text("**\(store.item?.subscriptionsString ?? "loading")** subscribers")
|
||||
.foregroundColor(.secondary)
|
||||
.opacity(store.item?.subscriptionsString != nil ? 1 : 0)
|
||||
|
||||
subscriptionToggleButton
|
||||
subscriptionToggleButton
|
||||
|
||||
FavoriteButton(item: FavoriteItem(section: .channel(channel.id, channel.name)))
|
||||
}
|
||||
FavoriteButton(item: FavoriteItem(section: .channel(channel.id, channel.name)))
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
.background(.thickMaterial)
|
||||
.background(.thickMaterial)
|
||||
#endif
|
||||
#if os(iOS)
|
||||
.sheet(isPresented: $presentingShareSheet) {
|
||||
if let url = accounts.api.shareURL(contentItem) {
|
||||
ShareSheet(activityItems: [url])
|
||||
}
|
||||
.sheet(isPresented: $presentingShareSheet) {
|
||||
if let url = accounts.api.shareURL(contentItem) {
|
||||
ShareSheet(activityItems: [url])
|
||||
}
|
||||
}
|
||||
#endif
|
||||
.modifier(UnsubscribeAlertModifier())
|
||||
.onAppear {
|
||||
if store.item.isNil {
|
||||
resource.addObserver(store)
|
||||
resource.load()
|
||||
}
|
||||
.onAppear {
|
||||
if store.item.isNil {
|
||||
resource.addObserver(store)
|
||||
resource.load()
|
||||
}
|
||||
.navigationTitle(navigationTitle)
|
||||
}
|
||||
.navigationTitle(navigationTitle)
|
||||
}
|
||||
|
||||
private var resource: Resource {
|
||||
|
@@ -14,8 +14,8 @@ struct PlayerControlsView<Content: View>: View {
|
||||
ZStack(alignment: .bottomLeading) {
|
||||
content
|
||||
#if !os(tvOS)
|
||||
.frame(minHeight: 0, maxHeight: .infinity)
|
||||
.padding(.bottom, 50)
|
||||
.frame(minHeight: 0, maxHeight: .infinity)
|
||||
.padding(.bottom, 50)
|
||||
#endif
|
||||
|
||||
#if !os(tvOS)
|
||||
|
@@ -142,7 +142,7 @@ struct SearchView: View {
|
||||
state.changeQuery { query in query.duration = duration }
|
||||
}
|
||||
#if !os(tvOS)
|
||||
.navigationTitle("Search")
|
||||
.navigationTitle("Search")
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -194,13 +194,13 @@ struct SearchView: View {
|
||||
state.changeQuery { query in query.query = item.title }
|
||||
}
|
||||
#if os(iOS)
|
||||
.swipeActions(edge: .trailing) {
|
||||
deleteButton(item)
|
||||
}
|
||||
.swipeActions(edge: .trailing) {
|
||||
deleteButton(item)
|
||||
}
|
||||
#elseif os(tvOS)
|
||||
.contextMenu {
|
||||
deleteButton(item)
|
||||
}
|
||||
.contextMenu {
|
||||
deleteButton(item)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -212,7 +212,7 @@ struct SearchView: View {
|
||||
}
|
||||
}
|
||||
#if os(iOS)
|
||||
.listStyle(.insetGrouped)
|
||||
.listStyle(.insetGrouped)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@@ -23,7 +23,7 @@ struct SignInRequiredView<Content: View>: View {
|
||||
}
|
||||
}
|
||||
#if !os(tvOS)
|
||||
.navigationTitle(title)
|
||||
.navigationTitle(title)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user