Extended Piped support

This commit is contained in:
Arkadiusz Fal
2021-10-21 00:21:50 +02:00
parent 2d075e7b3a
commit c3326a56af
46 changed files with 706 additions and 458 deletions

View File

@@ -18,10 +18,12 @@ struct TrendingView: View {
}
var resource: Resource {
let resource = accounts.invidious.trending(category: category, country: country)
resource.addObserver(store)
let newResource: Resource
return resource
newResource = accounts.api.trending(country: country, category: category)
newResource.addObserver(store)
return newResource
}
var body: some View {
@@ -56,20 +58,26 @@ struct TrendingView: View {
.toolbar {
#if os(macOS)
ToolbarItemGroup {
categoryButton
if accounts.app.supportsTrendingCategories {
categoryButton
}
countryButton
}
#elseif os(iOS)
ToolbarItemGroup(placement: .bottomBar) {
Group {
HStack {
Text("Category")
.foregroundColor(.secondary)
if accounts.app.supportsTrendingCategories {
HStack {
Text("Category")
.foregroundColor(.secondary)
categoryButton
// only way to disable Menu animation is to
// force redraw of the view when it changes
.id(UUID())
categoryButton
// only way to disable Menu animation is to
// force redraw of the view when it changes
.id(UUID())
}
} else {
Spacer()
}
HStack {
@@ -97,11 +105,13 @@ struct TrendingView: View {
var toolbar: some View {
HStack {
HStack {
Text("Category")
.foregroundColor(.secondary)
if accounts.app.supportsTrendingCategories {
HStack {
Text("Category")
.foregroundColor(.secondary)
categoryButton
categoryButton
}
}
#if os(iOS)