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

@@ -22,11 +22,11 @@ struct AccountsMenuView: View {
.transaction { t in t.animation = .none }
}
private var allAccounts: [Instance.Account] {
private var allAccounts: [Account] {
accounts + instances.map(\.anonymousAccount)
}
private func accountButtonTitle(account: Instance.Account) -> String {
private func accountButtonTitle(account: Account) -> String {
instances.count > 1 ? "\(account.description)\(account.instance.description)" : account.description
}
}

View File

@@ -32,17 +32,18 @@ struct Sidebar: View {
Label("Watch Now", systemImage: "play.circle")
.accessibility(label: Text("Watch Now"))
}
if accounts.signedIn {
if accounts.app.supportsSubscriptions && accounts.signedIn {
NavigationLink(destination: LazyView(SubscriptionsView()), tag: TabSelection.subscriptions, selection: $navigation.tabSelection) {
Label("Subscriptions", systemImage: "star.circle")
.accessibility(label: Text("Subscriptions"))
}
}
NavigationLink(destination: LazyView(PopularView()), tag: TabSelection.popular, selection: $navigation.tabSelection) {
Label("Popular", systemImage: "chart.bar")
.accessibility(label: Text("Popular"))
if accounts.app.supportsPopular {
NavigationLink(destination: LazyView(PopularView()), tag: TabSelection.popular, selection: $navigation.tabSelection) {
Label("Popular", systemImage: "chart.bar")
.accessibility(label: Text("Popular"))
}
}
NavigationLink(destination: LazyView(TrendingView()), tag: TabSelection.trending, selection: $navigation.tabSelection) {