Skip to content

Commit

Permalink
feat: add simple reporting mechanism to page (#75)
Browse files Browse the repository at this point in the history
* feat: add simple reporting mechanism to page

* fix: dynamically load email

* Fix: Update src/lib/components/Navigation.svelte

Co-authored-by: Moritz Twente <[email protected]>

* fix: link working on /partner /agenda

---------

Co-authored-by: Moritz Twente <[email protected]>
  • Loading branch information
maehr and mtwente authored Feb 13, 2024
1 parent 55bb63f commit 4cea7b5
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/lib/components/Navigation.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { page } from '$app/stores';
import { base } from '$app/paths';
import { getDrawerStore } from '@skeletonlabs/skeleton';
import * as config from '$lib/config';
const drawerStore = getDrawerStore();
const drawerClose = () => drawerStore.close();
Expand All @@ -14,6 +15,14 @@
{ label: 'Projekt', path: '/projekt' },
{ label: 'Über uns', path: '/ueber-uns' }
];
$: currentURL = $page.url.pathname;
const mailtoBody = encodeURI(
`Ich habe ein Problem auf der Seite entdeckt: ${currentURL}\n` +
`Art des Problems: [Bitte angeben: Technischer Fehler, Inhaltlicher Fehler, Tippfehler, Sonstiges]\n` +
`Beschreibung des Problems: [Bitte beschreiben Sie das Problem so genau wie möglich.]\n` +
`Weitere Anmerkungen: [Optional]\n` +
`Kontaktinformationen: [Optional, falls Rückmeldung erwünscht]\n`
);
$: isActive = (path) => {
if (path === '/blog' && $page.url.pathname.startsWith(base + path)) {
Expand All @@ -23,7 +32,11 @@
};
</script>

<nav class="list-nav p-4 text-xl" aria-label="Hauptmenü" data-sveltekit-preload-data>
<nav
class="list-nav flex h-full flex-col justify-between p-4 text-xl"
aria-label="Hauptmenü"
data-sveltekit-preload-data
>
<ul>
{#each navItems as { label, path }}
<li aria-current={isActive(path) ? 'page' : undefined}>
Expand All @@ -35,4 +48,10 @@
</li>
{/each}
</ul>

<a
class="variant-ringed btn btn-sm mt-4"
href="mailto:{config.email}?subject=Fehler%20auf%20{currentURL}&body={mailtoBody}"
>Fehler melden</a
>
</nav>

0 comments on commit 4cea7b5

Please sign in to comment.