Fix new offenses

This commit is contained in:
Arkadiusz Fal
2021-11-08 17:29:35 +01:00
parent 2701c1ccb5
commit db9f7e5f5d
29 changed files with 305 additions and 305 deletions

View File

@@ -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
}

View File

@@ -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 {

View File

@@ -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)

View File

@@ -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
}

View File

@@ -23,7 +23,7 @@ struct SignInRequiredView<Content: View>: View {
}
}
#if !os(tvOS)
.navigationTitle(title)
.navigationTitle(title)
#endif
}