web/Sidebar: dynamic settings tab link based on device type

This commit is contained in:
wukko 2024-06-25 00:12:23 +06:00
parent dd1f9b512f
commit 2c63d431d5
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2

View file

@ -1,4 +1,4 @@
<script>
<script lang="ts">
import CobaltLogo from "$components/sidebar/CobaltLogo.svelte";
import SidebarTab from "$components/sidebar/SidebarTab.svelte";
@ -12,9 +12,20 @@
import IconHeart from "@tabler/icons-svelte/IconHeart.svelte";
import IconInfoCircle from "@tabler/icons-svelte/IconInfoCircle.svelte";
const settingsLink = "/settings/general/appearance";
let screenWidth: number,
settingsLink: string;
$: isMobile = screenWidth <= 750;
$: if (isMobile) {
settingsLink = "/settings";
} else {
settingsLink = "/settings/general/appearance";
}
</script>
<svelte:window bind:innerWidth={screenWidth} />
<nav id="sidebar">
<CobaltLogo />
<div id="sidebar-tabs">
@ -89,7 +100,7 @@
}
#sidebar::before {
content: '';
content: "";
z-index: 1;
width: 100%;
height: 100%;