Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ladislas/feature/contentkit add skills model #643

Merged
merged 4 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ authors:
- aurore_kiesler

skills:
- skill_one
- skill_two
- skill_three
- spatial_understanding
- recognition/animals
- communication/non_verbal_communication/gestures

tags:
- tag_one
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,15 @@ struct MainView: View {

DisclosureGroup("**Skills**") {
ForEach(self.activity?.skills ?? [], id: \.self) { skill in
Text(skill)
let skill = Skills.skill(id: skill)!
HStack {
Text(skill.name)
Button {
self.selectedSkill = skill
} label: {
Image(systemName: "info.circle")
}
}
}
}

Expand All @@ -93,14 +101,31 @@ struct MainView: View {
.markdownTheme(.leka)
}
}
.sheet(item: self.$selectedSkill, onDismiss: { self.selectedSkill = nil }, content: { skill in
VStack(alignment: .leading) {
Text(skill.name)
.font(.headline)
Text(skill.description)
}
})
.onAppear {
self.activity = ContentKit.decodeActivity("activity")
print(self.activity ?? "not working")

let skills = Skills.list
for (index, skill) in skills.enumerated() {
print("skill \(index + 1)")
print("id: \(skill.id)")
print("name: \(skill.name)")
print("description: \(skill.description)")
}
}
}

// MARK: Private

@State private var selectedSkill: Skill?

@State private var activity: Activity?
}

Expand Down
1 change: 1 addition & 0 deletions Modules/ContentKit/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ let project = Project.module(
dependencies: [
.project(target: "LocalizationKit", path: Path("../../Modules/LocalizationKit")),
.project(target: "LogKit", path: Path("../../Modules/LogKit")),
.external(name: "Version"),
.external(name: "Yams"),
]
)
Loading
Loading