diff --git a/apps/dashboard/src/lib/components/Course/components/Lesson/AddLessonModal.svelte b/apps/dashboard/src/lib/components/Course/components/Lesson/AddLessonModal.svelte index f94202f3..449ca5fb 100644 --- a/apps/dashboard/src/lib/components/Course/components/Lesson/AddLessonModal.svelte +++ b/apps/dashboard/src/lib/components/Course/components/Lesson/AddLessonModal.svelte @@ -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 @@ >
diff --git a/apps/dashboard/src/lib/components/PageNav/index.svelte b/apps/dashboard/src/lib/components/PageNav/index.svelte index 8f1403f1..2abe9211 100644 --- a/apps/dashboard/src/lib/components/PageNav/index.svelte +++ b/apps/dashboard/src/lib/components/PageNav/index.svelte @@ -21,75 +21,79 @@
- {#if !!title} - {#if isTitleEditable} - {#if !enterEditTitleMode} - + {:else} + { + enterEditTitleMode = false; + + if (typeof onEditComplete === 'function') { + onEditComplete(); + } + }} + /> + {/if} + {:else} +
+

{title}

- - {:else} - { - enterEditTitleMode = false; - - if (typeof onEditComplete === 'function') { - onEditComplete(); - } - }} - /> +
{/if} - {:else} -
- -

- {title} -

+ {/if} + {#if Array.isArray(navItems) && navItems.length} +
+ {#each navItems as item} + + {item.label} + + {#if typeof item.badgeValue === 'number'} + + {/if} + + + {/each} + {#if addButtonHref} + + {/if}
{/if} - {/if} - {#if Array.isArray(navItems) && navItems.length} -
- {#each navItems as item} - - {item.label} - - {#if typeof item.badgeValue === 'number'} - - {/if} - - - {/each} - {#if addButtonHref} - - {/if} -
- {/if} - + +