mirror of
https://github.com/revanced/revanced-website.git
synced 2025-04-29 22:24:31 +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">
|
||||
import { page } from '$app/stores';
|
||||
import RouterEvents from '$data/RouterEvents';
|
||||
export let href: string;
|
||||
</script>
|
||||
|
||||
<a data-sveltekit-preload-data {href}>
|
||||
<!-- 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>
|
||||
</li>
|
||||
</a>
|
||||
|
Loading…
x
Reference in New Issue
Block a user