diff --git a/src/lib/layout/navigation.svelte b/src/lib/layout/navigation.svelte index 27934cf2d..5acfc9244 100644 --- a/src/lib/layout/navigation.svelte +++ b/src/lib/layout/navigation.svelte @@ -4,9 +4,18 @@ import { trackEvent } from '$lib/actions/analytics'; $: project = $page.params.project; - $: path = `${base}/console/project-${project}`; + $: projectPath = `${base}/console/project-${project}`; - let narrow = true; + $: secondSideNav = $page.data.secondSideNav; + // We need to have this second variable, because we only want narrow + // to change automatically if we change from having a second side nav to + // not having one, not when the second side nav changes to a different value. + $: hasSecondSideNav = !!secondSideNav; + + let narrow = false; + $: { + narrow = hasSecondSideNav; + }
@@ -19,10 +28,10 @@ trackEvent('click_menu_overview')} - href={path}> + href={projectPath}> @@ -30,9 +39,11 @@
  • trackEvent('click_menu_auth')} - href={`${path}/auth`}> + href={`${projectPath}/auth`}> @@ -41,10 +52,10 @@ trackEvent('click_menu_databases')} - href={`${path}/databases`}> + href={`${projectPath}/databases`}> @@ -53,10 +64,10 @@ trackEvent('click_menu_functions')} - href={`${path}/functions`}> + href={`${projectPath}/functions`}> @@ -64,9 +75,11 @@
  • trackEvent('click_menu_storage')} - href={`${path}/storage`}> + href={`${projectPath}/storage`}> @@ -79,72 +92,38 @@
    trackEvent('click_menu_settings')} - class:is-selected={$page.url.pathname.startsWith(`${path}/settings`)}> + class:is-selected={$page.url.pathname.startsWith( + `${projectPath}/settings` + )}>
  • {/if} - + + {#if secondSideNav} + + {/if} -
    -
    -
    - -
    Header
    - - -
    + {#if secondSideNav} +
    +
    + +
    -
    + {/if}