ui: Make others menu items active when on respective page

This commit is contained in:
nemunaire 2024-09-18 10:56:25 +02:00
parent 5981240280
commit 0669f74395
2 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,6 @@
<script> <script>
import { base } from '$app/paths'; import { base } from '$app/paths';
import { page } from '$app/stores';
import { import {
Badge, Badge,
@ -62,7 +63,7 @@
<NavbarToggler on:click={() => (isOpen = !isOpen)} /> <NavbarToggler on:click={() => (isOpen = !isOpen)} />
<Collapse {isOpen} navbar expand="md" on:update={handleUpdate}> <Collapse {isOpen} navbar expand="md" on:update={handleUpdate}>
<Nav navbar> <Nav navbar>
<NavItem> <NavItem active={$page.route && $page.route.id === "/"}>
<NavLink href="."> <NavLink href=".">
<Icon name="house" /> <Icon name="house" />
Accueil Accueil
@ -71,7 +72,7 @@
<NavThemes /> <NavThemes />
<NavTags /> <NavTags />
{#if $settings && $settings.end - $settings.start > 0 && $teams && Object.keys($teams).length} {#if $settings && $settings.end - $settings.start > 0 && $teams && Object.keys($teams).length}
<NavItem> <NavItem active={$page.route && $page.route.id === "/rank"}>
<NavLink href="rank"> <NavLink href="rank">
<Icon name="sort-down" /> <Icon name="sort-down" />
Classement Classement
@ -79,7 +80,7 @@
</NavItem> </NavItem>
{/if} {/if}
<HeaderIssues /> <HeaderIssues />
<NavItem> <NavItem active={$page.route && $page.route.id === "/rules"}>
<NavLink href="rules"> <NavLink href="rules">
<Icon name="signpost-split" /> <Icon name="signpost-split" />
Aide Aide

View File

@ -1,4 +1,6 @@
<script> <script>
import { page } from '$app/stores';
import { import {
Badge, Badge,
Icon, Icon,
@ -24,7 +26,7 @@
</script> </script>
{#if $issues.length} {#if $issues.length}
<NavItem> <NavItem active={$page.route && $page.route.id === "/issues"}>
<NavLink href="issues"> <NavLink href="issues">
<Icon name="bug" /> <Icon name="bug" />
Problèmes Problèmes