From 7f37897502e309c3d9c5dd10a3757b7b55cfd576 Mon Sep 17 00:00:00 2001 From: Arvid Norlin Date: Mon, 12 Feb 2024 11:08:09 +0100 Subject: [PATCH 1/2] fix: add missing footer links --- components/Current/Footer/Navigation.tsx | 42 ++++++++++++----- components/Current/Footer/index.tsx | 59 ++++++++++++++++-------- types/components/current/footer.ts | 13 +++++- 3 files changed, 81 insertions(+), 33 deletions(-) diff --git a/components/Current/Footer/Navigation.tsx b/components/Current/Footer/Navigation.tsx index 199748fc0..b49b48de7 100644 --- a/components/Current/Footer/Navigation.tsx +++ b/components/Current/Footer/Navigation.tsx @@ -1,17 +1,32 @@ -import { FooterNavigationProps } from "@/types/components/current/footer" -import { InternalLink, ExternalLink } from "@/types/requests/footer" +import { + FooterNavigationProps, + FooterNavigationItemProps, +} from "@/types/components/current/footer" +import Link from "next/link" -function getLink(linkObject: InternalLink | ExternalLink) { +function NavigationItem({ linkObject, lang }: FooterNavigationItemProps) { if (linkObject.__typename === "FooterNavigationLinksInternalLink") { - return { - title: linkObject.internal_link.link_text, - href: linkObject.internal_link.pageConnection.edges[0].node.url, - } + console.log({ foobar: JSON.stringify(linkObject) }) + const href = `/${lang}${linkObject.internal_link.pageConnection.edges[0].node.url}` + return ( +
  • + {linkObject.internal_link.link_text} +
  • + ) } - return linkObject.external_link.link + return ( +
  • + + {linkObject.external_link.link.title} + +
  • + ) } -export default function Navigation({ linkGroups }: FooterNavigationProps) { +export default function Navigation({ + linkGroups, + lang, +}: FooterNavigationProps) { return ( -
    - +
    +

    @@ -74,10 +77,14 @@ export default async function Footer({ lang }: LangParams) { > { @@ -98,11 +105,13 @@ export default async function Footer({ lang }: LangParams) { > {

    -

    {footerData.social_media.title}

    +

    + {footerData.social_media.title} +

    - {footerData.social_media.facebook.title} + + {footerData.social_media.facebook.title} + @@ -192,7 +205,9 @@ display: none; role="img" aria-labelledby="social-icons twitter-icon" > - {footerData.social_media.twitter.title} + + {footerData.social_media.twitter.title} + @@ -210,13 +225,17 @@ display: none; role="img" aria-labelledby="social-icons instagram-icon" > - {footerData.social_media.instagram.title} + + {footerData.social_media.instagram.title} +
    -

    {footerData.trip_advisor.title}

    +

    + {footerData.trip_advisor.title} +

    Trip Advisor logotype Date: Mon, 12 Feb 2024 11:39:33 +0100 Subject: [PATCH 2/2] chore: remove console.logs --- components/Current/Footer/Navigation.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/components/Current/Footer/Navigation.tsx b/components/Current/Footer/Navigation.tsx index b49b48de7..50bc4e56f 100644 --- a/components/Current/Footer/Navigation.tsx +++ b/components/Current/Footer/Navigation.tsx @@ -6,7 +6,6 @@ import Link from "next/link" function NavigationItem({ linkObject, lang }: FooterNavigationItemProps) { if (linkObject.__typename === "FooterNavigationLinksInternalLink") { - console.log({ foobar: JSON.stringify(linkObject) }) const href = `/${lang}${linkObject.internal_link.pageConnection.edges[0].node.url}` return (
  • @@ -36,8 +35,6 @@ export default function Navigation({

    {group.title}

      {group.links.map((link, idx) => { - console.log({ foobar: link }) - return ( )