feat(WEB-111): adjust footer for updated model
This commit is contained in:
@@ -1,49 +1,24 @@
|
|||||||
import {
|
import type { FooterNavigationProps } from "@/types/components/current/footer"
|
||||||
FooterNavigationProps,
|
|
||||||
FooterNavigationItemProps,
|
|
||||||
} from "@/types/components/current/footer"
|
|
||||||
import Link from "next/link"
|
|
||||||
|
|
||||||
function NavigationItem({ linkObject, lang }: FooterNavigationItemProps) {
|
export default function Navigation({ linkGroups }: FooterNavigationProps) {
|
||||||
if (linkObject.__typename === "FooterNavigationLinksInternalLink") {
|
|
||||||
const href = `/${lang}${linkObject.internal_link.pageConnection.edges[0].node.url}`
|
|
||||||
return (
|
|
||||||
<li>
|
|
||||||
<Link href={href}>{linkObject.internal_link.link_text}</Link>
|
|
||||||
</li>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return (
|
|
||||||
<li>
|
|
||||||
<a href={linkObject.external_link.link.href}>
|
|
||||||
{linkObject.external_link.link.title}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function Navigation({
|
|
||||||
linkGroups,
|
|
||||||
lang,
|
|
||||||
}: FooterNavigationProps) {
|
|
||||||
return (
|
return (
|
||||||
<ul className="l-footer-sections global-footer__content__sections">
|
<ul className="l-footer-sections global-footer__content__sections">
|
||||||
{linkGroups.map((group) => {
|
{linkGroups.map((group) => (
|
||||||
return (
|
|
||||||
<li className="global-footer-section" key={group.title}>
|
<li className="global-footer-section" key={group.title}>
|
||||||
<div className="link-list">
|
<div className="link-list">
|
||||||
<h3 className="link-list-header">{group.title}</h3>
|
<h3 className="link-list-header">{group.title}</h3>
|
||||||
<ul className="list-footer-pages">
|
<ul className="list-footer-pages">
|
||||||
{group.links.map((link, idx) => {
|
{group.links.map(link => (
|
||||||
return (
|
<li key={link.href}>
|
||||||
<NavigationItem key={idx} linkObject={link} lang={lang} />
|
<a href={link.href}>
|
||||||
)
|
{link.title}
|
||||||
})}
|
</a>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
)
|
))}
|
||||||
})}
|
|
||||||
</ul>
|
</ul>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export default async function Footer({ lang }: LangParams) {
|
|||||||
data-js-collapsible="global-footer"
|
data-js-collapsible="global-footer"
|
||||||
className="collapsible-global-footer"
|
className="collapsible-global-footer"
|
||||||
>
|
>
|
||||||
<Navigation lang={lang} linkGroups={footerData.navigation} />
|
<Navigation linkGroups={footerData.navigation} />
|
||||||
|
|
||||||
<div className="global-footer__content__bottom">
|
<div className="global-footer__content__bottom">
|
||||||
<p className="newFooterTitle">
|
<p className="newFooterTitle">
|
||||||
|
|||||||
@@ -1,33 +1,9 @@
|
|||||||
#import "../PageLinks.graphql"
|
|
||||||
|
|
||||||
fragment Navigation on Footer {
|
fragment Navigation on Footer {
|
||||||
navigation {
|
navigation {
|
||||||
links {
|
links {
|
||||||
... on FooterNavigationLinksInternalLink {
|
|
||||||
__typename
|
|
||||||
internal_link {
|
|
||||||
link_text
|
|
||||||
pageConnection {
|
|
||||||
edges {
|
|
||||||
node {
|
|
||||||
__typename
|
|
||||||
...CurrentBlocksPageLink
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
... on FooterNavigationLinksExternalLink {
|
|
||||||
__typename
|
|
||||||
external_link {
|
|
||||||
link {
|
|
||||||
href
|
href
|
||||||
title
|
title
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
title
|
title
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,5 @@
|
|||||||
import { Lang } from "@/types/lang"
|
import type { NavigationItem } from "@/types/requests/footer"
|
||||||
import {
|
|
||||||
ExternalLink,
|
|
||||||
InternalLink,
|
|
||||||
NavigationItem,
|
|
||||||
} from "@/types/requests/footer"
|
|
||||||
|
|
||||||
export type FooterNavigationProps = {
|
export type FooterNavigationProps = {
|
||||||
linkGroups: NavigationItem[]
|
linkGroups: NavigationItem[]
|
||||||
lang: Lang
|
|
||||||
}
|
|
||||||
|
|
||||||
export type FooterNavigationItemProps = {
|
|
||||||
linkObject: InternalLink | ExternalLink
|
|
||||||
lang: Lang
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,33 +1,19 @@
|
|||||||
import type { AllRequestResponse } from "./utils/all"
|
import type { AllRequestResponse } from "./utils/all"
|
||||||
import type { Edges } from "./utils/edges"
|
import type { Edges } from "./utils/edges"
|
||||||
import type { Image } from "../image"
|
import type { Image } from "../image"
|
||||||
import type { PageLink } from "./utils/pageLink"
|
|
||||||
|
|
||||||
type AppDownload = {
|
type AppDownload = {
|
||||||
href: string
|
href: string
|
||||||
imageConnection: Edges<Image>
|
imageConnection: Edges<Image>
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InternalLink = {
|
export type Link = {
|
||||||
__typename: "FooterNavigationLinksInternalLink"
|
|
||||||
internal_link: {
|
|
||||||
link_text: string
|
|
||||||
pageConnection: Edges<PageLink>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export type ExternalLink = {
|
|
||||||
__typename: "FooterNavigationLinksExternalLink"
|
|
||||||
external_link: {
|
|
||||||
link: {
|
|
||||||
href: string
|
href: string
|
||||||
title: string
|
title: string
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export type NavigationItem = {
|
export type NavigationItem = {
|
||||||
links: (ExternalLink | InternalLink)[]
|
links: Link[]
|
||||||
title: string
|
title: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user