Skip to content

Commit

Permalink
Merge pull request #635 from Dark-Matter-Labs/staging
Browse files Browse the repository at this point in the history
Fix hotjar and about page navigation order
  • Loading branch information
theocampbell authored Aug 12, 2024
2 parents 6800e0b + 9930f47 commit 0004bb2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
12 changes: 11 additions & 1 deletion app/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,17 @@ export const metadata = {

async function getNavData() {
const navData = await client.fetch(NAV_QUERY, {
next: { tags: ['aboutPages', 'navigation', 'thema', 'simpleThema', 'euLaw', 'siteConfig', 'navigation'] },
next: {
tags: [
'aboutPages',
'navigation',
'thema',
'simpleThema',
'euLaw',
'siteConfig',
'navigation',
],
},
});
if (!navData) {
throw new Error('could not fetch navData');
Expand Down
4 changes: 1 addition & 3 deletions components/layouts/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ export default function Layout({
}) {
const vraagSlug = '/vraag-en-antwoord';

// const hotjarConsent = getCookie('localConsent');

useEffect(() => {
if (hotjarCookie === true) {
if (hotjarCookie === 'true') {
console.log('hotjar turned on');
hotjar.initialize(Number(process.env.NEXT_PUBLIC_HJID), Number(process.env.NEXT_PUBLIC_HJSV));
}
Expand Down
7 changes: 6 additions & 1 deletion lib/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,12 @@ export const ABOUT_PAGE_QUERY = `
pageTitle,
aboutPageContent,
slug,
"slugs": *[_type == 'aboutPage']{"slug": slug.current, pageTitle}
"slugs": *[_type == "siteConfig"][]{
'aboutNavItems': overCirculaw->items[]{
"slug": navigationItemUrl.internalLink->slug.current,
"pageTitle": navigationItemUrl.internalLink->pageTitle
}
}.aboutNavItems[],
}
`;

Expand Down

0 comments on commit 0004bb2

Please sign in to comment.