ui: Make menu item active according to the visited scenario

This commit is contained in:
nemunaire 2024-03-16 10:15:18 +01:00
parent 4c29f2e53e
commit d234bbf272
2 changed files with 5 additions and 4 deletions

View File

@ -58,7 +58,7 @@
</div>
{/if}
<div class="sticky-top">
<Navbar color="dark" dark expand="md">
<Navbar color="primary" dark expand="md">
<NavbarToggler on:click={() => (isOpen = !isOpen)} />
<Collapse {isOpen} navbar expand="md" on:update={handleUpdate}>
<Nav navbar>

View File

@ -8,12 +8,13 @@
Icon,
} from '@sveltestrap/sveltestrap';
import { current_exercice } from '$lib/stores/exercices';
import { my } from '$lib/stores/my.js';
import { max_solved } from '$lib/stores/themes.js';
import { current_theme, max_solved } from '$lib/stores/themes.js';
import { myThemes, themes } from '$lib/stores/mythemes.js';
</script>
<Dropdown nav inNavbar>
<Dropdown nav inNavbar active={$current_theme}>
<DropdownToggle nav caret>
<Icon name="tv" />
Scenarii
@ -21,7 +22,7 @@
<DropdownMenu class="niceborder">
<div>
{#each $themes as th, index}
<DropdownItem href="{th.urlid}">
<DropdownItem href="{th.urlid}" active={$current_theme && $current_theme.id == th.id}>
{th.name}
{#if $max_solved > 1 && th.solved == $max_solved}
<Badge color="danger">