Add chips to tab and page nav

This commit is contained in:
rotimi-best
2021-08-31 21:59:17 +03:00
parent 4b75bc862f
commit 72c31a0776
9 changed files with 56 additions and 9 deletions
@@ -64,15 +64,19 @@
}
prevLessonId = lessonId;
setLesson(lessonData);
const totalExercises =
lessonData.totalExercises[0] && lessonData.totalExercises[0].count;
setLesson(lessonData, totalExercises);
}
function setLesson(lessonData) {
function setLesson(lessonData, totalExercises) {
if (!lessonData) return;
lesson.update((l) => ({
...l,
id: lessonId,
totalExercises,
materials: lessonData,
}));
}
@@ -97,6 +101,7 @@
},
{
label: 'Exercises',
badgeValue: $lesson.totalExercises,
isActive: !isMaterialsTabActive,
href: `${path}/exercises`,
},