feat(SW-187): Footer data from contentstack
This commit is contained in:
@@ -8,7 +8,7 @@ import Navigation from "./Navigation"
|
||||
import styles from "./footer.module.css"
|
||||
|
||||
export default async function Footer() {
|
||||
const footerData = await serverClient().contentstack.base.footer({
|
||||
const footerData = await serverClient().contentstack.base.currentFooter({
|
||||
lang: getLang(),
|
||||
})
|
||||
if (!footerData) {
|
||||
|
||||
@@ -11,11 +11,11 @@ export default function FooterMainNav({ mainLinks }: FooterMainNavProps) {
|
||||
<nav className={styles.mainNavigation}>
|
||||
<ul className={styles.mainNavigationList}>
|
||||
{mainLinks.map((link) => (
|
||||
<li key={link.id} className={styles.mainNavigationItem}>
|
||||
<li key={link.title} className={styles.mainNavigationItem}>
|
||||
<Subtitle type="two" asChild>
|
||||
<Link
|
||||
color="burgundy"
|
||||
href={link.href}
|
||||
href={link.url}
|
||||
className={styles.mainNavigationLink}
|
||||
>
|
||||
{link.title}
|
||||
|
||||
@@ -4,8 +4,9 @@ import FooterSecondaryNav from "./SecondaryNav"
|
||||
|
||||
import styles from "./navigation.module.css"
|
||||
|
||||
export default function FooterNavigation() {
|
||||
const { mainLinks, secondaryLinks, appDownloads } = footer
|
||||
export default function FooterNavigation({ ...props }) {
|
||||
const { mainLinks } = props
|
||||
const { secondaryLinks, appDownloads } = footer
|
||||
return (
|
||||
<section className={styles.section}>
|
||||
<div className={styles.maxWidth}>
|
||||
|
||||
@@ -1,10 +1,21 @@
|
||||
import { serverClient } from "@/lib/trpc/server"
|
||||
|
||||
import { getLang } from "@/i18n/serverContext"
|
||||
|
||||
import FooterDetails from "./Details"
|
||||
import FooterNavigation from "./Navigation"
|
||||
|
||||
export default function Footer() {
|
||||
export default async function Footer() {
|
||||
const footerData = await serverClient().contentstack.base.footer({
|
||||
lang: getLang(),
|
||||
})
|
||||
if (!footerData) {
|
||||
return null
|
||||
}
|
||||
console.log("footerData:", footerData)
|
||||
return (
|
||||
<footer>
|
||||
<FooterNavigation />
|
||||
<FooterNavigation {...footerData} />
|
||||
<FooterDetails />
|
||||
</footer>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user