mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-15 12:50:01 +00:00
web/Sidebar: dynamic settings tab link based on device type
This commit is contained in:
parent
dd1f9b512f
commit
2c63d431d5
1 changed files with 14 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
||||||
<script>
|
<script lang="ts">
|
||||||
import CobaltLogo from "$components/sidebar/CobaltLogo.svelte";
|
import CobaltLogo from "$components/sidebar/CobaltLogo.svelte";
|
||||||
import SidebarTab from "$components/sidebar/SidebarTab.svelte";
|
import SidebarTab from "$components/sidebar/SidebarTab.svelte";
|
||||||
|
|
||||||
|
@ -12,9 +12,20 @@
|
||||||
import IconHeart from "@tabler/icons-svelte/IconHeart.svelte";
|
import IconHeart from "@tabler/icons-svelte/IconHeart.svelte";
|
||||||
import IconInfoCircle from "@tabler/icons-svelte/IconInfoCircle.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>
|
</script>
|
||||||
|
|
||||||
|
<svelte:window bind:innerWidth={screenWidth} />
|
||||||
|
|
||||||
<nav id="sidebar">
|
<nav id="sidebar">
|
||||||
<CobaltLogo />
|
<CobaltLogo />
|
||||||
<div id="sidebar-tabs">
|
<div id="sidebar-tabs">
|
||||||
|
@ -89,7 +100,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#sidebar::before {
|
#sidebar::before {
|
||||||
content: '';
|
content: "";
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
Loading…
Reference in a new issue