Sources/OrgstarMobile/AppSidebar.swift

29b770d6b2f9edcc6607ab4a46db6c659dd12c1d
orgstar/Sources/OrgstarMobile/AppSidebar.swift

29 lines · 1078 bytes

 1#if os(iOS)
 2import OrgApp
 3import SwiftUI
 4
 5/// The sidebar of a regular-width iPad window: the iPhone's tabs, search, and each added folder.
 6struct AppSidebar: View {
 7    let workspace: WorkspaceModel
 8    @Binding var selection: AppTab
 9
10    var body: some View {
11        List(selection: Binding<AppTab?> { selection } set: { if let new = $0 { selection = new } }) {
12            Section {
13                Label("Agenda", systemImage: "calendar").tag(AppTab.agenda)
14                Label("Search", systemImage: "magnifyingglass").tag(AppTab.search)
15            }
16            Section("Folders") {
17                Label("All Folders", systemImage: "folder").tag(AppTab.folders)
18                ForEach(workspace.rootPaths, id: \.self) { root in
19                    Label((root as NSString).lastPathComponent, systemImage: "folder").tag(AppTab.folder(root))
20                }
21            }
22            Section {
23                Label("Settings", systemImage: "gearshape").tag(AppTab.settings)
24            }
25        }
26        .navigationTitle(Text(verbatim: "orgstar"))
27    }
28}
29#endif
Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form