Skip to content

Commit

Permalink
fix: doc navigation bar
Browse files Browse the repository at this point in the history
  • Loading branch information
6eDesign committed Sep 16, 2021
1 parent 0e2ff61 commit 0384cf7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
3 changes: 2 additions & 1 deletion src/lib/docs/NavBarItem.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<script>
import CrossfadeProvider from '$lib/components/generic/crossfade/CrossfadeProvider.svelte';
import { createEventDispatcher, getContext } from 'svelte';
import { base } from '$app/paths';
const page = getContext('navbar');
const dispatch = createEventDispatcher();
export let href;
export let isActive = (path) => path === href;
export let isActive = (path) => `${base}${path}` === href;
const click = (evt) => dispatch('click', evt);
Expand Down
11 changes: 1 addition & 10 deletions src/routes/__layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{ href: `${base}/docs/examples`, text: 'Examples' },
{
href: `${base}/docs/theme-editor/light`,
isActive: (p) => p.startsWith(`${base}/docs/theme-editor`),
isActive: (p) => p.startsWith(`/docs/theme-editor`),
text: 'Theme Editor'
}
];
Expand Down Expand Up @@ -57,15 +57,6 @@
</NavBar>
<div class="route-wrapper">
<slot />
<!-- Can consider re-adding this but would want to avoid transition between theme pages -->
<!-- <Swappable
magnitude={0.06}
vertical={true}
value={$page.path}
getId={(path) => links.findIndex(({ href }) => path === href)}
>
<slot />
</Swappable> -->
</div>
</div>
</div>
Expand Down

0 comments on commit 0384cf7

Please sign in to comment.