chore: improve style of lesson card (#177)

* chore: reduce size of lesson card based off customer review

* more styling improvements
This commit is contained in:
Rotimi Best
2024-02-21 18:59:10 +01:00
committed by GitHub
parent 4d312cab18
commit 7f24da00a5
3 changed files with 123 additions and 190 deletions
@@ -28,8 +28,8 @@
is_unlocked: false
};
function getLessonOrder(id = '') {
const index = $lessons.findIndex((lesson) => lesson.id === id);
function getLessonOrder(id = '', fallbackIndex) {
const index = fallbackIndex || $lessons.findIndex((lesson) => lesson.id === id);
if (index < 9) {
return '0' + (index + 1);
} else {
@@ -65,7 +65,7 @@
>
<div class="mr-5">
<TextChip
value={getLessonOrder(lesson.id || '')}
value={getLessonOrder('', $lessons.length)}
size="sm"
shape="rounded-full"
className="bg-primary-200 text-primary-600 text-xs"
@@ -75,9 +75,10 @@
<div class="w-full md:w-4/5">
<div class="flex flex-row gap-1 md:gap-2">
<TextField
label="Lesson title"
bind:value={lesson.title}
autofocus={true}
className=" flex-1 min-w-lg max-w-lg"
className="flex-1 min-w-lg max-w-lg"
isRequired={true}
errorMessage={errors.title}
/>