Skip to content

armgit / VERT

Public Imported from GitHub
0

The next-generation file converter. Open source, fully local* and free forever.

fix: footer links causing full-page reload

Maya45db10552123
diff --git a/src/lib/components/layout/Footer.svelte b/src/lib/components/layout/Footer.svelte
index 0425caa..9ca0efc 100644
--- a/src/lib/components/layout/Footer.svelte
+++ b/src/lib/components/layout/Footer.svelte
@@ -7,16 +7,10 @@
? __COMMIT_HASH__
: null;
- const items = $derived([
- [m["footer.source_code"](), GITHUB_URL_VERT],
- [m["footer.discord_server"](), DISCORD_URL],
- [m["footer.privacy_policy"](), "/privacy"],
- ...(commitHash
- ? [[commitHash, `${GITHUB_URL_VERT}/commit/${commitHash}`]]
- : []),
- ]);
-
const year = new Date().getFullYear();
+
+ // we can't use svelte snippets or a derived object to render the footer as it causes a full-page reload
+ // ...for some reason. i have no idea, maybe it's to do with the {#key $locale} in +layout.svelte
</script>
<footer
@@ -26,17 +20,39 @@
class="w-full h-full flex items-center justify-center text-muted gap-3 relative"
>
<p>{m["footer.copyright"]({ year })}</p>
- {#each items as [name, url] (name)}
- <!-- bullet point -->
+ <p>•</p>
+ <a
+ class="hover:underline font-normal"
+ href={GITHUB_URL_VERT}
+ target="_blank"
+ >
+ {m["footer.source_code"]()}
+ </a>
+ <p>•</p>
+ <a
+ class="hover:underline font-normal"
+ href={DISCORD_URL}
+ target="_blank"
+ >
+ {m["footer.discord_server"]()}
+ </a>
+ <p>•</p>
+ <a
+ class="hover:underline font-normal"
+ href="/privacy/"
+ >
+ {m["footer.privacy_policy"]()}
+ </a>
+ {#if commitHash}
<p>•</p>
<a
class="hover:underline font-normal"
- href={url}
- target={url.startsWith("http") ? "_blank" : "_self"}
+ href="{GITHUB_URL_VERT}/commit/{commitHash}"
+ target="_blank"
>
- {name}
+ {commitHash}
</a>
- {/each}
+ {/if}
</div>
<div