ui: Next button is back!

This commit is contained in:
Pierre-Olivier Mercier 2023-04-03 23:09:55 +02:00
parent 0c7eecf315
commit 4d7161281d

View File

@ -13,6 +13,15 @@
export let theme = {};
export let exercice = {};
let next = null;
$: {
for (const ex of theme.exercices) {
if (ex.id == exercice.id && ex.next) {
next = ex.next;
}
}
}
</script>
<Card class="border-success mb-2">
@ -36,8 +45,8 @@
<hr>
{/if}
{/if}
{#if theme.exercices[exercice.id] && theme.exercices[exercice.id].next}
<a href="{theme.urlid}/{theme.exercices[theme.exercices[exercice.id].next].urlid}" class="btn btn-success">Passer au défi suivant</a>
{#if next}
<a href="{theme.urlid}/{theme.exercices[next].urlid}" class="btn btn-success">Passer au défi suivant</a>
{/if}
</CardBody>
</Card>