Skip to content

Commit

Permalink
add slot to render passed in components
Browse files Browse the repository at this point in the history
  • Loading branch information
MaHaWo committed Aug 19, 2024
1 parent dcbd5d1 commit 19e59e3
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/lib/components/AbstractContent.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@
$: lastpage = '/';
$: nextpage = '/';
$: infopage = '/';
// actual content: this is a callback function that creates a new page element
export let content = null;
</script>

<!-- Top element-->
Expand All @@ -70,24 +67,23 @@
</Navbar>

<!--Content goes here-->
{#if content}
<svelte:component this={content} />
{/if}
<slot></slot>
<!-- FIXME: check slots again to make sure I use it correctly-->

{#if showBottomNavbar}
<!-- bottom element: back, info and next buttons-->
<BottomNav position="absolute" classInner="grid-cols-3">
<BottomNavItem href={lastpage} btnName="Back" btnClass={basicColorBehavior}>
<BottomNavItem href={lastpage} btnName="Zurück" btnClass={basicColorBehavior}>
<CaretLeftSolid class={bottomBarBtnClass} />
<Tooltip arrow={false}>Zur letzten Seite</Tooltip>
</BottomNavItem>
<BottomNavItem href={infopage} btnName="Help" btnClass={basicColorBehavior}>
<BottomNavItem href={infopage} btnName="Hilfe" btnClass={basicColorBehavior}>
<LightbulbSolid class={bottomBarBtnClass} />
<Tooltip arrow={false}>Hilfe</Tooltip>
</BottomNavItem>
<BottomNavItem href={nextpage} btnName="Next" btnClass={basicColorBehavior}>
<BottomNavItem href={nextpage} btnName="Weiter" btnClass={basicColorBehavior}>
<CaretRightSolid class={bottomBarBtnClass} />
<Tooltip arrow={false}>Zur naechsten Seite</Tooltip>
<Tooltip arrow={false}>Zur nächsten Seite</Tooltip>
</BottomNavItem>
</BottomNav>
{/if}

0 comments on commit 19e59e3

Please sign in to comment.