mirror of
https://github.com/revanced/revanced-website.git
synced 2025-04-30 06:34:35 +02:00
fix(nav): use RouterEvents instead of page store for highlighting
dammit afn
This commit is contained in:
parent
715cb6a37d
commit
1881f6c903
@ -1,11 +1,11 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores';
|
import RouterEvents from '$data/RouterEvents';
|
||||||
export let href: string;
|
export let href: string;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<a data-sveltekit-preload-data {href}>
|
<a data-sveltekit-preload-data {href}>
|
||||||
<!-- Check if href is equal to the first path -->
|
<!-- Check if href is equal to the first path -->
|
||||||
<li class:selected={href === '/' + $page.url.pathname.split('/')[1]}>
|
<li class:selected={href === '/' + $RouterEvents.target_url.pathname.split('/')[1]}>
|
||||||
<span><slot /></span>
|
<span><slot /></span>
|
||||||
</li>
|
</li>
|
||||||
</a>
|
</a>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user