Skip to content

Commit

Permalink
add additional route
Browse files Browse the repository at this point in the history
  • Loading branch information
MaHaWo committed Aug 21, 2024
1 parent 8d80ac5 commit 065b019
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
13 changes: 10 additions & 3 deletions src/lib/components/AbstractContent.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,20 @@
export let userName = 'Registrieren';
// FIXME: these are placeholders and must later be changed using contexts or other better mechanisms for inter component comunication
export let lastPage = '/';
export let nextPage = '/';
export let infoPage = '/';
export function onclickNext() {
console.log('Next page');
console.log('Next page', nextPage);
}
export function onclickLast() {
console.log('Last page');
console.log('Last page', lastPage);
}
export function onclickInfo() {
console.log('Info page');
console.log('Info page', infoPage);
}
</script>

Expand Down Expand Up @@ -90,6 +94,7 @@
btnName="Zurück"
btnClass="text-gray-500 dark:text-gray-400 hover:text-primary-800 dark:hover:text-primary-500 group-hover:text-primary-800 dark:group-hover:text-primary-500"
on:click={onclickLast}
href={lastPage}
>
<CaretLeftSolid
class="mb-1 h-8 w-8 text-gray-500 hover:text-primary-800 group-hover:text-primary-800 dark:text-gray-400 dark:hover:text-primary-500 dark:group-hover:text-primary-500"
Expand All @@ -100,6 +105,7 @@
btnName="Hilfe"
btnClass="text-gray-500 dark:text-gray-400 hover:text-primary-800 dark:hover:text-primary-500 group-hover:text-primary-800 dark:group-hover:text-primary-500"
on:click={onclickLast}
href={infoPage}
>
<LightbulbSolid
class="mb-1 h-8 w-8 text-gray-500 hover:text-primary-800 group-hover:text-primary-800 dark:text-gray-400 dark:hover:text-primary-500 dark:group-hover:text-primary-500"
Expand All @@ -110,6 +116,7 @@
btnName="Weiter"
btnClass="text-gray-500 dark:text-gray-400 hover:text-primary-800 dark:hover:text-primary-500 group-hover:text-primary-800 dark:group-hover:text-primary-500"
on:click={onclickNext}
href={nextPage}
>
<CaretRightSolid
class="mb-1 h-8 w-8 text-gray-500 hover:text-primary-800 group-hover:text-primary-800 dark:text-gray-400 dark:hover:text-primary-500 dark:group-hover:text-primary-500"
Expand Down
6 changes: 3 additions & 3 deletions src/routes/dummydropdown/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script>
import AbstractContent from '$lib/components/AbstractContent.svelte';
import DummyDropdown from '$lib/components/DummyDropdown.svelte';
</script>

<AbstractContent showBottomNavbar={true}>
<!-- <DummyDropdown /> -->
<h1>Test</h1>
<AbstractContent showBottomNavbar={true} lastPage="/" nextPage="/" infoPage="/info">
<DummyDropdown />
</AbstractContent>
5 changes: 5 additions & 0 deletions src/routes/info/+layout.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<script>
import '../../app.css';
</script>

<slot></slot>
1 change: 1 addition & 0 deletions src/routes/info/+layout.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const prerender = true;
7 changes: 7 additions & 0 deletions src/routes/info/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<script>
import AbstractContent from '$lib/components/AbstractContent.svelte';
</script>

<AbstractContent showBottomNavbar={true}>
<h1>Info page</h1>
</AbstractContent>

0 comments on commit 065b019

Please sign in to comment.