idek what i was doing bruh
This commit is contained in:
@@ -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")")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user