UX: actually show 'finish' and hide 'back'-button on the first slide

This commit is contained in:
Pieter Vander Vennet 2023-10-26 13:57:42 +02:00
parent d9b8d7613b
commit 09e511ca10
2 changed files with 5 additions and 2 deletions

View file

@ -1,6 +1,6 @@
<script lang="ts">
import * as nmd from "nano-markdown";
import nmd from "nano-markdown";
import { createEventDispatcher } from "svelte";
import WalkthroughStep from "./WalkthroughStep.svelte";
import FromHtml from "../Base/FromHtml.svelte";
@ -9,6 +9,7 @@
* Markdown
*/
export let pages: string[];
console.log("Walkthrough pages are", pages)
let currentPage: number = 0;
@ -26,7 +27,7 @@
</script>
<WalkthroughStep on:back={() => step(-1)} on:next={() => step(1)}>
<WalkthroughStep on:back={() => step(-1)} on:next={() => step(1)} isFirst={currentPage === 0} islast={currentPage + 1 === pages.length}>
<FromHtml src={nmd(pages[currentPage])} />
</WalkthroughStep>

View file

@ -21,6 +21,8 @@
<BackButton clss="w-full" on:click={() => dispatch("back")}>
Back
</BackButton>
{:else}
<div class="w-full"/>
{/if}
<NextButton clss="primary w-full" on:click={() => dispatch("next")}>
{#if islast}