feat(SW-187) Secondary navigation

This commit is contained in:
Pontus Dreij
2024-08-30 08:48:28 +02:00
parent 59263dbc66
commit d4dd21dda7
9 changed files with 29 additions and 18 deletions

View File

@@ -52,7 +52,7 @@
gap: var(--Spacing-x1); gap: var(--Spacing-x1);
} }
@media screen and (min-width: 1367px) { @media screen and (min-width: 767px) {
.details { .details {
padding: var(--Spacing-x6) var(--Spacing-x5) var(--Spacing-x4); padding: var(--Spacing-x6) var(--Spacing-x5) var(--Spacing-x4);
} }

View File

@@ -22,7 +22,7 @@
justify-content: space-between; justify-content: space-between;
} }
@media screen and (min-width: 1367px) { @media screen and (min-width: 767px) {
.mainNavigation { .mainNavigation {
max-width: 360px; max-width: 360px;
} }

View File

@@ -13,6 +13,7 @@ export default function FooterSecondaryNav({
secondaryLinks, secondaryLinks,
appDownloads, appDownloads,
}: FooterSecondaryNavProps) { }: FooterSecondaryNavProps) {
console.log("secondaryLinks", secondaryLinks[0].links)
return ( return (
<div className={styles.secondaryNavigation}> <div className={styles.secondaryNavigation}>
<nav className={styles.secondaryNavigationGroup}> <nav className={styles.secondaryNavigationGroup}>
@@ -25,9 +26,9 @@ export default function FooterSecondaryNav({
<a href={link.href} target="_blank" aria-label={link.title}> <a href={link.href} target="_blank" aria-label={link.title}>
<Image <Image
src={ src={
AppDownLoadLinks[link.id as keyof typeof AppDownLoadLinks] AppDownLoadLinks[link.type as keyof typeof AppDownLoadLinks]
} }
alt={link.title} alt={link.href.title}
width={125} width={125}
height={40} height={40}
/> />

View File

@@ -25,7 +25,7 @@
margin: 0; margin: 0;
} }
@media screen and (min-width: 1367px) { @media screen and (min-width: 767px) {
.secondaryNavigation { .secondaryNavigation {
margin-top: 0; margin-top: 0;
gap: 80px; gap: 80px;

View File

@@ -1,12 +1,10 @@
import { footer } from "../mockedData"
import FooterMainNav from "./MainNav" import FooterMainNav from "./MainNav"
import FooterSecondaryNav from "./SecondaryNav" import FooterSecondaryNav from "./SecondaryNav"
import styles from "./navigation.module.css" import styles from "./navigation.module.css"
export default function FooterNavigation({ ...props }) { export default function FooterNavigation({ ...props }) {
const { mainLinks } = props const { mainLinks, secondaryLinks, appDownloads } = props
const { secondaryLinks, appDownloads } = footer
return ( return (
<section className={styles.section}> <section className={styles.section}>
<div className={styles.maxWidth}> <div className={styles.maxWidth}>

View File

@@ -11,7 +11,7 @@
max-width: var(--max-width-content); max-width: var(--max-width-content);
} }
@media screen and (min-width: 1367px) { @media screen and (min-width: 767px) {
.section { .section {
padding: var(--Spacing-x9) 0; padding: var(--Spacing-x9) 0;
} }

View File

@@ -283,8 +283,8 @@ const validateInternalLink = z
edges: z.array( edges: z.array(
z.object({ z.object({
node: z.object({ node: z.object({
title: z.string(), title: z.string().optional(),
url: z.string(), url: z.string().optional(),
}), }),
}) })
), ),

View File

@@ -572,11 +572,21 @@ export const baseQueryRouter = router({
const mainLinks = transformPageConnectionLinks( const mainLinks = transformPageConnectionLinks(
validatedFooterData.main_links validatedFooterData.main_links
) )
console.log(
"secondary_links ",
validatedFooterData.secondary_links[0].links[0].pageConnection?.edges
)
const secondaryLinks = validatedFooterData.secondary_links.map(
(section) => ({
...section,
links: transformPageConnectionLinks(section.links),
})
)
return { return {
mainLinks: mainLinks, mainLinks: mainLinks,
appDownloads: validatedFooterData.app_downloads, appDownloads: validatedFooterData.app_downloads,
secondaryLinks: validatedFooterData.secondary_links, secondaryLinks: secondaryLinks,
} }
}), }),
}) })

View File

@@ -8,10 +8,10 @@ export type FooterMainNavProps = {
export type FooterSecondaryNav = { export type FooterSecondaryNav = {
id: string id: string
href: string
title: string
openInNewTab: boolean
isExternal: boolean isExternal: boolean
openInNewTab: boolean
title: string
url: string
} }
export type FooterSecondaryNavProps = { export type FooterSecondaryNavProps = {
secondaryLinks: { secondaryLinks: {
@@ -21,9 +21,11 @@ export type FooterSecondaryNavProps = {
appDownloads: { appDownloads: {
title: string title: string
links: { links: {
title: string href: {
href: string href: string
id: string title: string
}
type: string
}[] }[]
} }
} }