|
|
@@ -9,20 +9,25 @@ import SwiftUI
|
|
|
|
|
|
struct TaskView: View {
|
|
|
@Binding var task: Task
|
|
|
+ @State var showNotes: Bool = false
|
|
|
|
|
|
var body: some View {
|
|
|
- HStack {
|
|
|
- Picker("" /* TODO: Add Icons */, selection: $task.status) {
|
|
|
- ForEach(Status.allCases) { unit in
|
|
|
- Text(String(describing: unit))
|
|
|
- }
|
|
|
- }.scaledToFit()
|
|
|
- TextField("Task Name", text: $task.name)
|
|
|
- }
|
|
|
- HStack {
|
|
|
- TextField("Notes", text: $task.notes)
|
|
|
+ VStack {
|
|
|
+ HStack {
|
|
|
+ Picker("" /* TODO: Add Icons */, selection: $task.status) {
|
|
|
+ ForEach(Status.allCases) { unit in
|
|
|
+ Text(String(describing: unit))
|
|
|
+ }
|
|
|
+ }.scaledToFit()
|
|
|
+ TextField("Task Name", text: $task.name)
|
|
|
+ }
|
|
|
+ if showNotes {
|
|
|
+ TextField("Notes", text: $task.notes)
|
|
|
.font(.footnote)
|
|
|
.padding(.leading, 30)
|
|
|
+ }
|
|
|
+ }.onHover { yes in
|
|
|
+ showNotes = yes || !task.notes.isEmpty
|
|
|
}
|
|
|
}
|
|
|
}
|