idek what i was doing bruh

This commit is contained in:
june
2025-02-14 23:34:59 +13:00
parent 154c02ca6c
commit 9319e8904b
4 changed files with 81 additions and 74 deletions

View File

@@ -12,38 +12,23 @@ struct MainViewPresenter: View {
@Environment(\.modelContext) private var modelContext
@Query private var items: [OCProject]
@AppStorage(Preferences.themeColour) var themeColor = Color.blue.toHex()!
@State private var newProjectName = ""
@State private var addNewProject = false
var body: some View {
NavigationSplitView {
NavigationView {
List {
ForEach(items) { project in
NavigationLink {
CueCardViewPresenter(project: project)
} label: {
VStack(alignment: .leading) {
if (project.color == Color.clear.toHex()!) {
Text("\(project.name)")
.bold()
.font(.title2)
.foregroundStyle(Color(hex: themeColor) ?? .blue)
} else {
Text("\(project.name)")
.bold()
.font(.title2)
.foregroundStyle(Color(hex: project.color) ?? .white)
}
Text("\(project.cards?.count ?? 0) \(project.cards?.count ?? 0 == 1 ? "Card" : "Cards")")
} }
ProjectCard(project: project)
}
.padding(.vertical, 3)
}
}
.navigationTitle("Projects")
} detail: {
Text("Select an item")
}
}
}
@@ -57,3 +42,25 @@ struct MainViewPresenter: View {
return MainViewPresenter()
.modelContainer(container)
}
struct ProjectCard: View {
@AppStorage(Preferences.themeColour) var themeColor = Color.blue.toHex()!
let project: OCProject
var body: some View {
VStack(alignment: .leading) {
if (project.color == Color.clear.toHex()!) {
Text("\(project.name)")
.bold()
.font(.title2)
.foregroundStyle(Color(hex: themeColor) ?? .blue)
} else {
Text("\(project.name)")
.bold()
.font(.title2)
.foregroundStyle(Color(hex: project.color) ?? .white)
}
Text("\(project.cards?.count ?? 0) \(project.cards?.count ?? 0 == 1 ? "Card" : "Cards")")
}
}
}