mirror of
https://github.com/ReVanced/revanced-website.git
synced 2026-01-11 05:36:17 +00:00
fix(nav): use RouterEvents instead of page store for highlighting
dammit afn
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user