Tasks empty state
This commit is contained in:
@@ -190,6 +190,12 @@ private struct ProjectBlock: View {
|
|||||||
.font(Fonts.font(11))
|
.font(Fonts.font(11))
|
||||||
.foregroundStyle(Palette.muted)
|
.foregroundStyle(Palette.muted)
|
||||||
heading("Tasks")
|
heading("Tasks")
|
||||||
|
if active.isEmpty {
|
||||||
|
Text("No active tasks.")
|
||||||
|
.foregroundStyle(Palette.muted)
|
||||||
|
.padding(.horizontal, 10)
|
||||||
|
.padding(.vertical, 6)
|
||||||
|
}
|
||||||
TaskRows(active: active.filter { !$0.background })
|
TaskRows(active: active.filter { !$0.background })
|
||||||
ForEach(active.filter(\.background), id: \.id) { task in
|
ForEach(active.filter(\.background), id: \.id) { task in
|
||||||
BackgroundRow(task: task)
|
BackgroundRow(task: task)
|
||||||
@@ -230,12 +236,7 @@ private struct TaskRows: View {
|
|||||||
@Environment(Store.self) private var store
|
@Environment(Store.self) private var store
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
if active.isEmpty {
|
if !active.isEmpty {
|
||||||
Text("No active tasks.")
|
|
||||||
.foregroundStyle(Palette.muted)
|
|
||||||
.padding(.horizontal, 10)
|
|
||||||
.padding(.vertical, 6)
|
|
||||||
} else {
|
|
||||||
VStack(alignment: .leading, spacing: 0) {
|
VStack(alignment: .leading, spacing: 0) {
|
||||||
ForEach(nested(store, active), id: \.task.id) { row in
|
ForEach(nested(store, active), id: \.task.id) { row in
|
||||||
TaskRow(task: row.task, depth: row.depth)
|
TaskRow(task: row.task, depth: row.depth)
|
||||||
|
|||||||
Reference in New Issue
Block a user