|
1 | 1 | import React from "react" |
2 | | -import Link from "next/link" |
3 | | -import { t } from "@bloom-housing/ui-components" |
| 2 | +import { Link } from "@bloom-housing/ui-seeds" |
4 | 3 | import MaxWidthLayout from "../../layouts/max-width" |
| 4 | +import { |
| 5 | + FooterContent, |
| 6 | + FooterLinks, |
| 7 | + getGenericFooterLinksContent, |
| 8 | + getGenericFooterTextContent, |
| 9 | +} from "../../static_content/generic_footer_content" |
| 10 | +import { |
| 11 | + getJurisdictionFooterLinksContent, |
| 12 | + getJurisdictionFooterTextContent, |
| 13 | +} from "../../static_content/jurisdiction_footer_content" |
5 | 14 | import styles from "./CustomSiteFooter.module.scss" |
6 | 15 |
|
7 | 16 | const CustomSiteFooter = () => { |
| 17 | + const textContent: FooterContent | null = |
| 18 | + getJurisdictionFooterTextContent() || getGenericFooterTextContent() |
| 19 | + const footerLinksContent: FooterLinks | null = |
| 20 | + getJurisdictionFooterLinksContent() || getGenericFooterLinksContent() |
| 21 | + |
| 22 | + const showContentFooter = textContent.logo || textContent.textSections?.length > 0 |
| 23 | + const showLinksFooter = footerLinksContent.links?.length > 0 || footerLinksContent.cityString |
| 24 | + |
| 25 | + if (!showContentFooter && !showLinksFooter) return <></> |
| 26 | + |
8 | 27 | return ( |
9 | 28 | <footer> |
10 | | - <MaxWidthLayout className={styles["footer-container"]}> |
11 | | - <div className={styles["footer-content-container"]}> |
12 | | - <div className={styles["footer"]}> |
13 | | - <div className={styles["icon-container"]}> |
14 | | - <a href={"/"} className={styles["jurisdiction-icon"]}> |
15 | | - <img src="/images/default-housing-logo.svg" alt={"Jurisdiction Logo"} /> |
16 | | - </a> |
17 | | - </div> |
18 | | - <div className={styles["text-container"]}> |
19 | | - <span>{t("footer.content.projectOf")}</span> |
20 | | - <Link href={"/"}>Mayor's Office of Housing Development</Link> |
21 | | - </div> |
22 | | - <div className={styles["text-container"]}> |
23 | | - <span>{t("footer.content.partnership")}</span> |
24 | | - <Link href={"/"}>Bloomington Department of Technology</Link> |
25 | | - <Link href={"/"}>Mayor's Office of Civic Innovation</Link> |
26 | | - </div> |
27 | | - <div className={styles["text-container"]}> |
28 | | - <p>{t("footer.content.applicationQuestions")}</p> |
29 | | - <p>{t("footer.content.programQuestions")}</p> |
| 29 | + {showContentFooter && ( |
| 30 | + <MaxWidthLayout className={styles["footer-container"]}> |
| 31 | + <div className={styles["footer-content-container"]}> |
| 32 | + <div className={styles["footer"]}> |
| 33 | + {textContent.logo && ( |
| 34 | + <div className={styles["icon-container"]}> |
| 35 | + <a href={textContent.logo.logoUrl || "/"} className={styles["jurisdiction-icon"]}> |
| 36 | + <img |
| 37 | + src={textContent.logo.logoSrc} |
| 38 | + alt={textContent.logo.logoAltText || "Jurisdiction Logo"} |
| 39 | + /> |
| 40 | + </a> |
| 41 | + </div> |
| 42 | + )} |
| 43 | + {textContent.textSections.map((section, index) => ( |
| 44 | + <div key={index} className={styles["text-container"]}> |
| 45 | + {section} |
| 46 | + </div> |
| 47 | + ))} |
30 | 48 | </div> |
31 | 49 | </div> |
32 | | - </div> |
33 | | - </MaxWidthLayout> |
34 | | - <MaxWidthLayout |
35 | | - className={`${styles["footer-content-container"]} ${styles["copyright-content-container"]}`} |
36 | | - > |
37 | | - <div className={`${styles["footer"]} ${styles["copyright"]}`}> |
38 | | - <div className={styles["copyright-text"]}>{t("footer.copyright")}</div> |
39 | | - <div className={styles.links}> |
40 | | - <Link href="/">{t("footer.giveFeedback")}</Link> |
41 | | - <Link href="/">{t("footer.contact")}</Link> |
42 | | - <Link href="/privacy">{t("pageTitle.privacy")}</Link> |
43 | | - <Link href="/disclaimer">{t("pageTitle.disclaimer")}</Link> |
| 50 | + </MaxWidthLayout> |
| 51 | + )} |
| 52 | + {showLinksFooter && ( |
| 53 | + <MaxWidthLayout |
| 54 | + className={`${styles["footer-content-container"]} ${styles["copyright-content-container"]}`} |
| 55 | + > |
| 56 | + <div className={`${styles["footer"]} ${styles["copyright"]}`}> |
| 57 | + <div className={styles["copyright-text"]}>{footerLinksContent.cityString || ""}</div> |
| 58 | + <div className={styles.links}> |
| 59 | + {footerLinksContent.links?.map((link, index) => ( |
| 60 | + <Link key={index} href={link.href}> |
| 61 | + {link.text} |
| 62 | + </Link> |
| 63 | + ))} |
| 64 | + </div> |
44 | 65 | </div> |
45 | | - </div> |
46 | | - </MaxWidthLayout> |
| 66 | + </MaxWidthLayout> |
| 67 | + )} |
47 | 68 | </footer> |
48 | 69 | ) |
49 | 70 | } |
|
0 commit comments