From 2bd4e25403ccbc332e3031cd41a8ffe2eb114937 Mon Sep 17 00:00:00 2001 From: Arvid Norlin Date: Thu, 8 Feb 2024 14:22:13 +0000 Subject: [PATCH] Merged in feat/footer (pull request #11) Feat/footer * chore: correct type * fix: remove redundant return type * chore: align code formatting * chore: format code to avoid diffing noise * chore: clean up format diffing noise * chore: move props tying to types folder * fix: update app_downloads usage and types * fix: improve footer query and typings * refactor: add Image.graphql * fix: correct typings --- app/[lang]/current-content-page/page.tsx | 29 +- components/Current/Footer/Da.tsx | 320 ----------------- components/Current/Footer/De.tsx | 177 --------- components/Current/Footer/En.tsx | 335 ------------------ components/Current/Footer/Fi.tsx | 323 ----------------- components/Current/Footer/Navigation.tsx | 34 ++ components/Current/Footer/No.tsx | 193 ---------- components/Current/Footer/Sv.tsx | 318 ----------------- components/Current/Footer/index.tsx | 251 +++++++++++-- lib/graphql/Fragments/Blocks/List.graphql | 4 +- .../Fragments/Footer/AppDownloads.graphql | 27 ++ lib/graphql/Fragments/Footer/Logo.graphql | 10 + .../Fragments/Footer/Navigation.graphql | 34 ++ .../Fragments/Footer/SocialMedia.graphql | 17 + .../Fragments/Footer/TripAdvisor.graphql | 14 + lib/graphql/Fragments/Hero.graphql | 2 +- lib/graphql/Fragments/Image.graphql | 13 + lib/graphql/Query/Footer.graphql | 26 ++ lib/request.ts | 17 +- types/components/current/footer.ts | 5 + types/requests/blocks/text.ts | 7 +- types/requests/footer.ts | 71 ++++ 22 files changed, 504 insertions(+), 1723 deletions(-) delete mode 100644 components/Current/Footer/Da.tsx delete mode 100644 components/Current/Footer/De.tsx delete mode 100644 components/Current/Footer/En.tsx delete mode 100644 components/Current/Footer/Fi.tsx create mode 100644 components/Current/Footer/Navigation.tsx delete mode 100644 components/Current/Footer/No.tsx delete mode 100644 components/Current/Footer/Sv.tsx create mode 100644 lib/graphql/Fragments/Footer/AppDownloads.graphql create mode 100644 lib/graphql/Fragments/Footer/Logo.graphql create mode 100644 lib/graphql/Fragments/Footer/Navigation.graphql create mode 100644 lib/graphql/Fragments/Footer/SocialMedia.graphql create mode 100644 lib/graphql/Fragments/Footer/TripAdvisor.graphql create mode 100644 lib/graphql/Fragments/Image.graphql create mode 100644 lib/graphql/Query/Footer.graphql create mode 100644 types/components/current/footer.ts create mode 100644 types/requests/footer.ts diff --git a/app/[lang]/current-content-page/page.tsx b/app/[lang]/current-content-page/page.tsx index 9d37915e9..4490a153e 100644 --- a/app/[lang]/current-content-page/page.tsx +++ b/app/[lang]/current-content-page/page.tsx @@ -3,13 +3,13 @@ import { notFound } from "next/navigation"; import { request } from "@/lib/request" import { GetCurrentBlockPage } from "@/lib/graphql/Query/CurrentBlockPage.graphql" -import Aside from "@/components/Current/Aside"; -import Blocks from "@/components/Current/Blocks"; -import Header from "@/components/Current/Header"; -import Hero from "@/components/Current/Hero"; +import Aside from "@/components/Current/Aside" +import Blocks from "@/components/Current/Blocks" +import Header from "@/components/Current/Header" +import Hero from "@/components/Current/Hero" -import type { PageArgs, LangParams, UriParams } from "@/types/params"; -import type { GetCurrentBlockPageData } from "@/types/requests/currentBlockPage"; +import type { PageArgs, LangParams, UriParams } from "@/types/params" +import type { GetCurrentBlockPageData } from "@/types/requests/currentBlockPage" export default async function CurrentContentPage({ params, @@ -17,10 +17,13 @@ export default async function CurrentContentPage({ }: PageArgs) { try { if (!searchParams.uri) { - throw new Error("Bad URI"); + throw new Error("Bad URI") } - const response = await request(GetCurrentBlockPage, { locale: params.lang, url: searchParams.uri }) + const response = await request(GetCurrentBlockPage, { + locale: params.lang, + url: searchParams.uri, + }) if (!response.data?.all_current_blocks_page?.total) { console.log("#### DATA ####") @@ -36,17 +39,13 @@ export default async function CurrentContentPage({ <>
{images?.totalCount ? : null} -
+
- ); + ) } catch (err) { - return notFound(); + return notFound() } } diff --git a/components/Current/Footer/Da.tsx b/components/Current/Footer/Da.tsx deleted file mode 100644 index 7064988ee..000000000 --- a/components/Current/Footer/Da.tsx +++ /dev/null @@ -1,320 +0,0 @@ -/* eslint-disable @next/next/no-img-element */ -import Script from "next/script"; - -export default function DaFooter() { - return ( -