Skip to content

Commit

Permalink
⚗️ (ContentKit): Example - add real skills and get details
Browse files Browse the repository at this point in the history
  • Loading branch information
ladislas committed Feb 7, 2024
1 parent 8264bf9 commit 47aa70c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 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,6 +101,13 @@ 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")
Expand All @@ -109,6 +124,8 @@ struct MainView: View {

// MARK: Private

@State private var selectedSkill: Skill?

@State private var activity: Activity?
}

Expand Down

0 comments on commit 47aa70c

Please sign in to comment.