|
|
@@ -9,8 +9,9 @@ import SwiftUI
|
|
|
|
|
|
struct TaskView: View {
|
|
|
@Binding var task: Task
|
|
|
- @State var showNotes: Bool = false
|
|
|
-
|
|
|
+ @State private var showTags: Bool = false
|
|
|
+ @State private var showNotes: Bool = false
|
|
|
+
|
|
|
var body: some View {
|
|
|
VStack {
|
|
|
HStack {
|
|
|
@@ -21,12 +22,18 @@ struct TaskView: View {
|
|
|
}.scaledToFit()
|
|
|
TextField("Task Name", text: $task.name)
|
|
|
}
|
|
|
+ if showTags {
|
|
|
+ TagBarView(tags: $task.tags)
|
|
|
+ .font(.footnote)
|
|
|
+ .padding(.leading, 30)
|
|
|
+ }
|
|
|
if showNotes {
|
|
|
TextField("Notes", text: $task.notes)
|
|
|
.font(.footnote)
|
|
|
.padding(.leading, 30)
|
|
|
}
|
|
|
}.onHover { yes in
|
|
|
+ showTags = yes || !task.tags.isEmpty
|
|
|
showNotes = yes || !task.notes.isEmpty
|
|
|
}
|
|
|
}
|
|
|
@@ -35,4 +42,5 @@ struct TaskView: View {
|
|
|
#Preview {
|
|
|
@Previewable @State var task = Task(name: "New Task")
|
|
|
TaskView(task: $task)
|
|
|
+ .frame(minHeight: 100) // Preview does not resize window properly
|
|
|
}
|