|
|
@@ -13,7 +13,7 @@ struct ContentView: View {
|
|
|
@AppStorage(UserDefaultsKeys.WeekStart) private var weekStart = Date()
|
|
|
let inPreview = ProcessInfo.processInfo.environment["XCODE_RUNNING_FOR_PREVIEWS"] == "1"
|
|
|
|
|
|
- @Query private var items: [Category]
|
|
|
+ @Query private var items: [Project]
|
|
|
|
|
|
@State private var showingPopup = false
|
|
|
@State private var currentHint: URLHint = URLHint()
|
|
|
@@ -23,9 +23,9 @@ struct ContentView: View {
|
|
|
List {
|
|
|
ForEach(items) { item in
|
|
|
NavigationLink {
|
|
|
- CategoryPanelView(item: item)
|
|
|
+ ProjectPanelView(item: item)
|
|
|
} label: {
|
|
|
- CategorySidebarView(name: Bindable(item).name)
|
|
|
+ ProjectSidebarView(name: Bindable(item).name)
|
|
|
} .contextMenu {
|
|
|
Button(action: { deleteItem(item: item) }) {
|
|
|
Label("Delete", systemImage: "trash")
|
|
|
@@ -38,7 +38,7 @@ struct ContentView: View {
|
|
|
.toolbar {
|
|
|
ToolbarItem {
|
|
|
Button(action: addItem) {
|
|
|
- Label("New Category", systemImage: "plus")
|
|
|
+ Label("New Project", systemImage: "plus")
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -50,8 +50,8 @@ struct ContentView: View {
|
|
|
|
|
|
private func addItem() {
|
|
|
withAnimation {
|
|
|
- let newItem = Category(timestamp: Date())
|
|
|
- let count = items.count(where: { $0.name.starts(with: "New Category") })
|
|
|
+ let newItem = Project(timestamp: Date())
|
|
|
+ let count = items.count(where: { $0.name.starts(with: "New Project") })
|
|
|
if (count > 0) {
|
|
|
newItem.name += " (\(count))"
|
|
|
}
|
|
|
@@ -99,7 +99,7 @@ struct ContentView: View {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private func deleteItem(item: Category) {
|
|
|
+ private func deleteItem(item: Project) {
|
|
|
withAnimation {
|
|
|
modelContext.delete(item)
|
|
|
}
|
|
|
@@ -116,5 +116,5 @@ struct ContentView: View {
|
|
|
|
|
|
#Preview {
|
|
|
ContentView()
|
|
|
- .modelContainer(for: Category.self, inMemory: true)
|
|
|
+ .modelContainer(for: Project.self, inMemory: true)
|
|
|
}
|