Skip to content

Commit

Permalink
🔀 Merge branch 'ladislas/feature/contentkit-add-skills-model'
Browse files Browse the repository at this point in the history
  • Loading branch information
ladislas committed Feb 7, 2024
2 parents 4a267e3 + fa6e7ce commit 1f651e5
Show file tree
Hide file tree
Showing 5 changed files with 350 additions and 186 deletions.
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

0 comments on commit 1f651e5

Please sign in to comment.