mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Documents tab with file sharing
This commit is contained in:
@@ -14,6 +14,7 @@ struct AppTabNavigation: View {
|
||||
@EnvironmentObject<ThumbnailsModel> private var thumbnailsModel
|
||||
|
||||
@Default(.showHome) private var showHome
|
||||
@Default(.showDocuments) private var showDocuments
|
||||
@Default(.showOpenActionsToolbarItem) private var showOpenActionsToolbarItem
|
||||
@Default(.visibleSections) private var visibleSections
|
||||
|
||||
@@ -26,6 +27,10 @@ struct AppTabNavigation: View {
|
||||
homeNavigationView
|
||||
}
|
||||
|
||||
if showDocuments {
|
||||
documentsNavigationView
|
||||
}
|
||||
|
||||
if !accounts.isEmpty {
|
||||
if subscriptionsVisible {
|
||||
subscriptionsNavigationView
|
||||
@@ -73,6 +78,18 @@ struct AppTabNavigation: View {
|
||||
.tag(TabSelection.home)
|
||||
}
|
||||
|
||||
private var documentsNavigationView: some View {
|
||||
NavigationView {
|
||||
LazyView(DocumentsView())
|
||||
.toolbar { toolbarContent }
|
||||
}
|
||||
.tabItem {
|
||||
Label("Documents", systemImage: "folder")
|
||||
.accessibility(label: Text("Documents"))
|
||||
}
|
||||
.tag(TabSelection.documents)
|
||||
}
|
||||
|
||||
private var subscriptionsNavigationView: some View {
|
||||
NavigationView {
|
||||
LazyView(SubscriptionsView())
|
||||
|
@@ -6,6 +6,7 @@ struct Sidebar: View {
|
||||
@EnvironmentObject<NavigationModel> private var navigation
|
||||
|
||||
@Default(.showHome) private var showHome
|
||||
@Default(.showDocuments) private var showDocuments
|
||||
@Default(.visibleSections) private var visibleSections
|
||||
|
||||
var body: some View {
|
||||
@@ -48,6 +49,18 @@ struct Sidebar: View {
|
||||
}
|
||||
.id("favorites")
|
||||
}
|
||||
|
||||
#if os(iOS)
|
||||
if showDocuments {
|
||||
NavigationLink(destination: LazyView(DocumentsView()), tag: TabSelection.documents, selection: $navigation.tabSelection) {
|
||||
Label("Documents", systemImage: "folder")
|
||||
.accessibility(label: Text("Documents"))
|
||||
}
|
||||
.id("documents")
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if !accounts.isEmpty {
|
||||
if visibleSections.contains(.subscriptions),
|
||||
accounts.app.supportsSubscriptions && accounts.signedIn
|
||||
|
Reference in New Issue
Block a user