Add a Files tab to the project page
This commit is contained in:
@@ -17,11 +17,14 @@ struct ProjectView: View {
|
||||
VStack(spacing: 0) {
|
||||
if store.focusedProject() != nil {
|
||||
HStack(spacing: 4) {
|
||||
PaneTabButton(label: "Tasks", active: !overlays.projectSettings) {
|
||||
overlays.projectSettings = false
|
||||
PaneTabButton(label: "Tasks", active: overlays.projectTab == .tasks) {
|
||||
overlays.projectTab = .tasks
|
||||
}
|
||||
PaneTabButton(label: "Settings", active: overlays.projectSettings) {
|
||||
overlays.projectSettings = true
|
||||
PaneTabButton(label: "Files", active: overlays.projectTab == .files) {
|
||||
overlays.projectTab = .files
|
||||
}
|
||||
PaneTabButton(label: "Settings", active: overlays.projectTab == .settings) {
|
||||
overlays.projectTab = .settings
|
||||
}
|
||||
Spacer(minLength: 0)
|
||||
}
|
||||
@@ -30,14 +33,18 @@ struct ProjectView: View {
|
||||
Rectangle().fill(Palette.border).frame(height: 1)
|
||||
}
|
||||
}
|
||||
ScrollView {
|
||||
if let p = store.focusedProject() {
|
||||
ProjectBlock(project: p, todo: todos[p.id], settings: overlays.projectSettings)
|
||||
.padding(.horizontal, 16)
|
||||
.padding(.top, 8)
|
||||
.padding(.bottom, 16)
|
||||
} else {
|
||||
Muted(text: "No project selected.")
|
||||
if let p = store.focusedProject(), overlays.projectTab == .files {
|
||||
FilesView(root: .project(p.id))
|
||||
} else {
|
||||
ScrollView {
|
||||
if let p = store.focusedProject() {
|
||||
ProjectBlock(project: p, todo: todos[p.id], settings: overlays.projectTab == .settings)
|
||||
.padding(.horizontal, 16)
|
||||
.padding(.top, 8)
|
||||
.padding(.bottom, 16)
|
||||
} else {
|
||||
Muted(text: "No project selected.")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user