From 2bca310acc4ca22960c5902b402c2ae23d0f7755 Mon Sep 17 00:00:00 2001 From: secondl1ght <85003930+secondl1ght@users.noreply.github.com> Date: Sat, 30 Jul 2022 18:58:25 -0600 Subject: hook up all nav buttons, add dropdown menu, add routes... --- src/components/AppHeader.svelte | 65 +++++++++++++++++++++++++++++++------ src/components/LandingHeader.svelte | 28 +++++++++++----- 2 files changed, 74 insertions(+), 19 deletions(-) (limited to 'src/components') diff --git a/src/components/AppHeader.svelte b/src/components/AppHeader.svelte index 1c6f639c..9f73adbf 100644 --- a/src/components/AppHeader.svelte +++ b/src/components/AppHeader.svelte @@ -4,26 +4,65 @@ import { user } from '$lib/store'; import { goto } from '$app/navigation'; import { Icon } from '$comp'; + + const menuButtons = [ + { title: 'Customers', icon: 'customers', goto: 'customers' }, + { title: 'Dashboard', icon: 'dash', goto: 'dashboard' }, + { title: 'Settings', icon: 'settings', goto: 'settings' }, + { title: 'Support', icon: 'support', goto: 'support' }, + { title: 'Sign out', icon: 'logout', goto: 'logout' } + ]; + + let showMenu = false; + + const handleMenuItemClick = (item) => { + if (item === 'logout') { + goto('/logout'); + } else { + goto(`/${$user.username + '/' + item}`); + } + };
+ + diff --git a/src/components/LandingHeader.svelte b/src/components/LandingHeader.svelte index 4da9a17e..927c8749 100644 --- a/src/components/LandingHeader.svelte +++ b/src/components/LandingHeader.svelte @@ -2,6 +2,7 @@ import { goto } from '$app/navigation'; import { scroll } from '$lib/utils'; import { Icon } from '$comp'; + import { user } from '$lib/store'; export let howItWorks; export let faq; @@ -17,15 +18,24 @@ - - + {#if !$user} + + + {:else} + + {/if} -- cgit v1.2.3