UX: actually show 'finish' and hide 'back'-button on the first slide
This commit is contained in:
parent
d9b8d7613b
commit
09e511ca10
2 changed files with 5 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
|
||||||
import * as nmd from "nano-markdown";
|
import nmd from "nano-markdown";
|
||||||
import { createEventDispatcher } from "svelte";
|
import { createEventDispatcher } from "svelte";
|
||||||
import WalkthroughStep from "./WalkthroughStep.svelte";
|
import WalkthroughStep from "./WalkthroughStep.svelte";
|
||||||
import FromHtml from "../Base/FromHtml.svelte";
|
import FromHtml from "../Base/FromHtml.svelte";
|
||||||
|
@ -9,6 +9,7 @@
|
||||||
* Markdown
|
* Markdown
|
||||||
*/
|
*/
|
||||||
export let pages: string[];
|
export let pages: string[];
|
||||||
|
console.log("Walkthrough pages are", pages)
|
||||||
|
|
||||||
let currentPage: number = 0;
|
let currentPage: number = 0;
|
||||||
|
|
||||||
|
@ -26,7 +27,7 @@
|
||||||
</script>
|
</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])} />
|
<FromHtml src={nmd(pages[currentPage])} />
|
||||||
</WalkthroughStep>
|
</WalkthroughStep>
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
<BackButton clss="w-full" on:click={() => dispatch("back")}>
|
<BackButton clss="w-full" on:click={() => dispatch("back")}>
|
||||||
Back
|
Back
|
||||||
</BackButton>
|
</BackButton>
|
||||||
|
{:else}
|
||||||
|
<div class="w-full"/>
|
||||||
{/if}
|
{/if}
|
||||||
<NextButton clss="primary w-full" on:click={() => dispatch("next")}>
|
<NextButton clss="primary w-full" on:click={() => dispatch("next")}>
|
||||||
{#if islast}
|
{#if islast}
|
||||||
|
|
Loading…
Reference in a new issue