From 0096e3ebbfb5e67263b526a86f7097240e0dde68 Mon Sep 17 00:00:00 2001 From: Jordan Shatford Date: Wed, 27 Sep 2023 14:37:50 +1000 Subject: [PATCH] chore(web): cleanup routing utilities Signed-off-by: Jordan Shatford --- apps/web/src/lib/components/Logo.svelte | 2 +- .../web/src/lib/{utils/route.ts => routes.ts} | 14 +++++++++++++- apps/web/src/routes/+error.svelte | 2 +- apps/web/src/routes/+layout.svelte | 19 +++---------------- 4 files changed, 18 insertions(+), 19 deletions(-) rename apps/web/src/lib/{utils/route.ts => routes.ts} (67%) diff --git a/apps/web/src/lib/components/Logo.svelte b/apps/web/src/lib/components/Logo.svelte index a7a30429..3aca7e3a 100644 --- a/apps/web/src/lib/components/Logo.svelte +++ b/apps/web/src/lib/components/Logo.svelte @@ -1,5 +1,5 @@ diff --git a/apps/web/src/lib/utils/route.ts b/apps/web/src/lib/routes.ts similarity index 67% rename from apps/web/src/lib/utils/route.ts rename to apps/web/src/lib/routes.ts index 96c8ce1e..ae4e39de 100644 --- a/apps/web/src/lib/utils/route.ts +++ b/apps/web/src/lib/routes.ts @@ -1,4 +1,5 @@ import { DownloadIcon, GearIcon, MagnifyingGlassIcon, type IconSource } from '@yd/ui'; + export class RoutePathConstants { public static SEARCH = '/'; public static DOWNLOADS = '/downloads'; @@ -7,7 +8,7 @@ export class RoutePathConstants { public static TERMS_OF_USE = '/terms'; } -export const links: { href: string; text: string; icon?: IconSource }[] = [ +export const navbarLinks: { href: string; text: string; icon?: IconSource }[] = [ { text: 'Search', href: RoutePathConstants.SEARCH, @@ -24,3 +25,14 @@ export const links: { href: string; text: string; icon?: IconSource }[] = [ icon: GearIcon } ]; + +export const footerLinks: { href: string; text: string }[] = [ + { + href: RoutePathConstants.FAQ, + text: 'faq' + }, + { + href: RoutePathConstants.TERMS_OF_USE, + text: 'terms of use' + } +]; diff --git a/apps/web/src/routes/+error.svelte b/apps/web/src/routes/+error.svelte index c21bff19..bf33a87b 100644 --- a/apps/web/src/routes/+error.svelte +++ b/apps/web/src/routes/+error.svelte @@ -1,6 +1,6 @@ diff --git a/apps/web/src/routes/+layout.svelte b/apps/web/src/routes/+layout.svelte index d3f0cc72..e6674308 100644 --- a/apps/web/src/routes/+layout.svelte +++ b/apps/web/src/routes/+layout.svelte @@ -14,7 +14,7 @@ import { session } from '$lib/stores/session'; import { downloads } from '$lib/stores/downloads'; import config from '$lib/config'; - import { RoutePathConstants, links } from '$lib/utils/route'; + import { navbarLinks, footerLinks } from '$lib/routes'; import Logo from '$lib/components/Logo.svelte'; // Use session as token when making requests with client @@ -35,7 +35,7 @@
{#if $session}
- + @@ -47,17 +47,4 @@ {/if}
-