From 144ab30bc6f288fe970f2280e234873eabccb4f8 Mon Sep 17 00:00:00 2001 From: Pontus Dreij Date: Thu, 5 Sep 2024 09:34:02 +0200 Subject: [PATCH] feat(SW-187): Added social media data and copyright label --- components/Footer/Details/index.tsx | 51 +++++++------- .../Footer/Navigation/SecondaryNav/index.tsx | 69 ++++++++++--------- components/Footer/Navigation/index.tsx | 8 ++- components/Footer/index.tsx | 10 ++- i18n/dictionaries/da.json | 1 + i18n/dictionaries/de.json | 1 + i18n/dictionaries/en.json | 1 + i18n/dictionaries/fi.json | 1 + i18n/dictionaries/no.json | 1 + i18n/dictionaries/sv.json | 1 + .../Fragments/Footer/SocialMedia.graphql | 11 +++ lib/graphql/Query/Footer.graphql | 2 + server/routers/contentstack/base/output.ts | 8 +++ server/routers/contentstack/base/query.ts | 1 + server/routers/contentstack/base/utils.ts | 2 + types/components/footer/appDownloadIcons.ts | 14 ++++ types/components/footer/navigation.ts | 53 +++++++------- 17 files changed, 144 insertions(+), 91 deletions(-) create mode 100644 lib/graphql/Fragments/Footer/SocialMedia.graphql create mode 100644 types/components/footer/appDownloadIcons.ts diff --git a/components/Footer/Details/index.tsx b/components/Footer/Details/index.tsx index f420b0f60..70b7cffa2 100644 --- a/components/Footer/Details/index.tsx +++ b/components/Footer/Details/index.tsx @@ -3,12 +3,14 @@ import Image from "@/components/Image" import LanguageSwitcher from "@/components/LanguageSwitcher" import Link from "@/components/TempDesignSystem/Link" import Footnote from "@/components/TempDesignSystem/Text/Footnote" +import { getIntl } from "@/i18n" import { getLang } from "@/i18n/serverContext" import { footer } from "../mockedData" import styles from "./details.module.css" +import type { FooterDetailsProps } from "@/types/components/footer/navigation" import type { SocialIconsProps } from "@/types/components/footer/socialIcons" import { IconName } from "@/types/components/icon" @@ -17,16 +19,13 @@ function SocialIcon({ iconName }: SocialIconsProps) { return SocialIcon ? : {iconName} } -export default function FooterDetails() { +export default async function FooterDetails({ + socialMedia, +}: FooterDetailsProps) { const lang = getLang() + const { formatMessage } = await getIntl() const currentYear = new Date().getFullYear() - const { - socialMedia, - copyrightCompany, - copyrightInfo, - tertiaryLinks, - languageSwitcher, - } = footer + const { tertiaryLinks, languageSwitcher } = footer return (
@@ -43,27 +42,28 @@ export default function FooterDetails() { />
- © {currentYear} {copyrightCompany} - - - {copyrightInfo} + © {currentYear}{" "} + {formatMessage({ id: "Copyright all rights reserved" })}
@@ -81,9 +81,6 @@ export default function FooterDetails() { ))} - { - // This will be changed to the new LangueSwitcher that is done in the header branch, when implementing contentstack - }
diff --git a/components/Footer/Navigation/SecondaryNav/index.tsx b/components/Footer/Navigation/SecondaryNav/index.tsx index 2588a24fd..1524ffbb6 100644 --- a/components/Footer/Navigation/SecondaryNav/index.tsx +++ b/components/Footer/Navigation/SecondaryNav/index.tsx @@ -5,46 +5,49 @@ import { getLang } from "@/i18n/serverContext" import styles from "./secondarynav.module.css" -import { - AppDownLoadLinks, - type FooterSecondaryNavProps, -} from "@/types/components/footer/navigation" +import { AppDownLoadLinks } from "@/types/components/footer/appDownloadIcons" +import { type FooterSecondaryNavProps } from "@/types/components/footer/navigation" export default function FooterSecondaryNav({ secondaryLinks, appDownloads, }: FooterSecondaryNavProps) { const lang = getLang() - console.log("hej", JSON.stringify(secondaryLinks, null, 4)) + return (
- + {appDownloads && ( + + )} {secondaryLinks.map((link) => (