Skip to content

Commit

Permalink
feat(pdc-frontend): integrate nav wip
Browse files Browse the repository at this point in the history
  • Loading branch information
AliKdhim87 committed Sep 28, 2023
1 parent 894a6b7 commit ab4091e
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 32 deletions.
4 changes: 2 additions & 2 deletions apps/pdc-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
},
"dependencies": {
"@frameless/samenwerkende-catalogi": "0.0.0-semantically-released",
"@frameless/ui": "0.0.0-semantically-released",
"@tanstack/react-query": "4.29.12",
"@utrecht/component-library-css": "1.0.0-alpha.539",
"@utrecht/component-library-react": "1.0.0-alpha.348",
Expand All @@ -43,8 +44,7 @@
"rehype-raw": "6.1.1",
"sharp": "0.32.1",
"vega": "5.25.0",
"vega-lite": "5.14.1",
"yarn": "1.22.19"
"vega-lite": "5.14.1"
},
"devDependencies": {
"eslint": "8.35.0",
Expand Down
35 changes: 5 additions & 30 deletions apps/pdc-frontend/src/app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { dir } from 'i18next';
import type { Metadata } from 'next';
import React from 'react';
import { QueryClientProvider } from '@/client';
import { Page, PageContent, PageHeader, SkipLink, Surface } from '@/components';
import { Navigation, Page, PageContent, PageHeader, SkipLink, Surface } from '@/components';
import { ClientLanguageSwitcher } from '@/components/ClientLanguageSwitcher';
import '@utrecht/component-library-css';
import '../../styles/globals.css';
Expand All @@ -12,11 +12,14 @@ import { Footer } from '@/components/Footer';
import { Logo } from '@/components/Logo';
import { Main } from '@/components/Main';
import { SearchBar } from '@/components/SearchBar';
import { getNavListData } from '@/data';
import { getLiveSuggestions, onSearchSubmitAction } from './search/actions';
import 'react-loading-skeleton/dist/skeleton.css';
import { useTranslation } from '../i18n/index';
import { languages } from '../i18n/settings';

import '@frameless/ui/dist/bundle.css';

const escapeComment = (data: any) => String(data).replace(/--/g, '-\u200B-');

const HTMLComment = ({ data }: any) => (
Expand Down Expand Up @@ -200,35 +203,7 @@ const RootLayout = async ({ children, params: { locale } }: LayoutProps) => {
</div>
</div>
</PageHeader>
<nav className="utrecht-topnav" id="menu">
<ul className="utrecht-topnav__list">
<li className="utrecht-topnav__item">
<a className="utrecht-topnav__link" href="https://www.utrecht.nl/wonen-en-leven">
Wonen en leven
</a>
</li>
<li className="utrecht-topnav__item">
<a className="utrecht-topnav__link" href="https://www.utrecht.nl/zorg-en-onderwijs">
Zorg en onderwijs
</a>
</li>
<li className="utrecht-topnav__item">
<a className="utrecht-topnav__link" href="https://www.utrecht.nl/werk-en-inkomen">
Werk en inkomen
</a>
</li>
<li className="utrecht-topnav__item">
<a className="utrecht-topnav__link" href="https://www.utrecht.nl/ondernemen">
Ondernemen
</a>
</li>
<li className="utrecht-topnav__item">
<a className="utrecht-topnav__link" href="https://www.utrecht.nl/bestuur-en-organisatie">
Bestuur en organisatie
</a>
</li>
</ul>
</nav>
<Navigation list={getNavListData(t)} mobileBreakpoint={1400} />
<PageContent className="utrecht-page-content--modifier" style={{ position: 'relative' }}>
<Main id="main">{children}</Main>
</PageContent>
Expand Down
24 changes: 24 additions & 0 deletions apps/pdc-frontend/src/app/i18n/locales/en/layout.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,29 @@
"title": "Contact us via WhatsApp"
}
]
},
"navigation": {
"list": [
{
"title": "Living and Life",
"link": "https://www.utrecht.nl/wonen-en-leven"
},
{
"title": "Health and Education",
"link": "https://www.utrecht.nl/zorg-en-onderwijs"
},
{
"title": "Work and Income",
"link": "https://www.utrecht.nl/werk-en-inkomen"
},
{
"title": "Business",
"link": "https://www.utrecht.nl/ondernemen"
},
{
"title": "Government and Organization",
"link": "https://www.utrecht.nl/bestuur-en-organisatie"
}
]
}
}
24 changes: 24 additions & 0 deletions apps/pdc-frontend/src/app/i18n/locales/nl/layout.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,29 @@
"title": "Neem contact op via WhatsApp"
}
]
},
"navigation": {
"list": [
{
"title": "Wonen en leven",
"link": "https://www.utrecht.nl/wonen-en-leven"
},
{
"title": "Zorg en onderwijs",
"link": "https://www.utrecht.nl/zorg-en-onderwijs"
},
{
"title": "Werk en inkomen",
"link": "https://www.utrecht.nl/werk-en-inkomen"
},
{
"title": "Ondernemen",
"link": "https://www.utrecht.nl/ondernemen"
},
{
"title": "Bestuur en organisatie",
"link": "https://www.utrecht.nl/bestuur-en-organisatie"
}
]
}
}
23 changes: 23 additions & 0 deletions apps/pdc-frontend/src/data/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// eslint-disable-next-line no-unused-vars
export const getNavListData = (t: (text: string) => string) => [
{
title: t('navigation.list.0.title'),
link: t('navigation.list.0.link'),
},
{
title: t('navigation.list.1.title'),
link: t('navigation.list.1.link'),
},
{
title: t('navigation.list.2.title'),
link: t('navigation.list.2.link'),
},
{
title: t('navigation.list.3.title'),
link: t('navigation.list.3.link'),
},
{
title: t('navigation.list.4.title'),
link: t('navigation.list.4.link'),
},
];

0 comments on commit ab4091e

Please sign in to comment.