summaryrefslogtreecommitdiff
path: root/src/components/Navbar
diff options
context:
space:
mode:
authorJoe Carstairs <jcarstairs@scottlogic.com>2024-01-12 16:07:19 +0000
committerJoe Carstairs <jcarstairs@scottlogic.com>2024-01-12 16:07:19 +0000
commit23e63a1b391c90203f9cde8c939923a0d21ed1c3 (patch)
tree9c53a7d740c2b001e49dacaf0bc8264fef6cbf59 /src/components/Navbar
parent2bf64117190300caac82594cb7818dbc7f67af67 (diff)
Removes navlinks from navbar
Diffstat (limited to 'src/components/Navbar')
-rw-r--r--src/components/Navbar/Breadcrumbs.astro31
-rw-r--r--src/components/Navbar/NavLinks.astro28
-rw-r--r--src/components/Navbar/Navbar.astro8
3 files changed, 1 insertions, 66 deletions
diff --git a/src/components/Navbar/Breadcrumbs.astro b/src/components/Navbar/Breadcrumbs.astro
deleted file mode 100644
index f949873..0000000
--- a/src/components/Navbar/Breadcrumbs.astro
+++ /dev/null
@@ -1,31 +0,0 @@
----
-import findAllIndicesOf from '$lib/findAllIndicesOf';
-import translate from '$i18n/translate';
-import tBreadcrumbs from '$i18n/translations/components/breadcrumbs';
-import type Locale from '$types/Locale';
-import locales from '$i18n/locales';
-
-const path = Astro.url.pathname.replace(/(?<!\/)$/, '/');
-const localeInPath = new RegExp(`/(?<=^/)(${locales.join('|')})`);
-const locale = path.match(localeInPath)?.[1] as Locale;
-if (!locale) {
- return;
-}
-const pathWithoutLocale = path.replace(new RegExp(`^/${locale}`), '');
-const slashIndices = findAllIndicesOf('/', pathWithoutLocale);
-const parentRoutes = slashIndices.map((n) => pathWithoutLocale.slice(0, n + 1)).slice(0, -1);
-
-const t = translate(locale);
----
-
-<ol class="nav__breadcrumbs">
- {
- parentRoutes.map((route) => {
- return (
- <li>
- <a href={`/${locale}${route}`}>{t(tBreadcrumbs, { key: route })}</a>
- </li>
- );
- })
- }
-</ol>
diff --git a/src/components/Navbar/NavLinks.astro b/src/components/Navbar/NavLinks.astro
deleted file mode 100644
index 798c24e..0000000
--- a/src/components/Navbar/NavLinks.astro
+++ /dev/null
@@ -1,28 +0,0 @@
----
-import { getLocaleFromPathOrDefault } from '$lib/getLocaleFromPath';
-import translate from '$i18n/translate';
-import tNews from '$i18n/translations/pages/news';
-import tFurthsettins from '$i18n/translations/pages/furthsettins';
-import tHame from '$i18n/translations/pages/home';
-
-const locale = getLocaleFromPathOrDefault(Astro.url.pathname);
-const t = translate(locale);
----
-
-<ul class="nav__nav-links">
- <li>
- <a class="btn" href={`/${locale}/news`}>{t(tNews, { key: 'title' })}</a>
- </li>
- <li>
- <a class="btn" href={`/${locale}/#about`}>{t(tHame, { key: 'about-us' })}</a>
- </li>
- <li>
- <a class="btn" href={`/${locale}/furthsettins`}>{t(tFurthsettins, { key: 'title' })}</a>
- </li>
- <li>
- <a class="btn" href={`/${locale}/#jyne`}>{t(tHame, { key: 'jyne' })}</a>
- </li>
- <li>
- <a class="btn" href={`/${locale}/#contact`}>{t(tHame, { key: 'contact' })}</a>
- </li>
-</ul>
diff --git a/src/components/Navbar/Navbar.astro b/src/components/Navbar/Navbar.astro
index 4fa05a9..a6f8491 100644
--- a/src/components/Navbar/Navbar.astro
+++ b/src/components/Navbar/Navbar.astro
@@ -1,15 +1,9 @@
---
-import Breadcrumbs from './Breadcrumbs.astro';
import SwitchLanguageLink from '../SwitchLanguageLink.astro';
-import NavLinks from './NavLinks.astro';
import Logo from './Logo.astro';
---
<nav class="nav">
<Logo />
- <NavLinks />
- <div class="nav__bottom-row">
- <Breadcrumbs />
- <SwitchLanguageLink />
- </div>
+ <SwitchLanguageLink />
</nav>