Files
MindDump/MindDump/Views/MindDumpButton.swift

29 lines
831 B
Swift

import SwiftUI
// Floating action button for quick-dump. Adds to the current list or falls back to Inbox.
struct MindDumpButton: View {
@Environment(ListStore.self) private var store
var activeListID: UUID?
@State private var showingEditor = false
private var targetListID: UUID {
activeListID ?? store.inboxID
}
var body: some View {
Button {
showingEditor = true
} label: {
Text("🧠")
.font(.system(size: 28))
.frame(width: 56, height: 56)
.background(Circle().fill(.blue))
.shadow(color: .black.opacity(0.3), radius: 4, x: 0, y: 2)
}
.padding(24)
.sheet(isPresented: $showingEditor) {
TodoEditorView(listID: targetListID, item: nil)
}
}
}