From 6fc999327464683161569ddb2272b987f3e62039 Mon Sep 17 00:00:00 2001 From: james-a-morris Date: Thu, 5 Dec 2024 13:28:40 -0500 Subject: [PATCH] feat: add route footer Signed-off-by: james-a-morris --- src/app/_components/footer.tsx | 57 ++++++++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 13 deletions(-) diff --git a/src/app/_components/footer.tsx b/src/app/_components/footer.tsx index 582eb94..41cf9ce 100644 --- a/src/app/_components/footer.tsx +++ b/src/app/_components/footer.tsx @@ -21,6 +21,16 @@ import CustomLink from "./link"; import Link from "next/link"; import { TERMS_OF_SERVICE } from "../_constants/links"; +type LinkType = { + label: string; + href: string; + description?: string; + Icon?: (props: React.SVGProps) => React.JSX.Element; + iconClassName?: string; + iconContainerClassName?: string; + highlightLink?: boolean; +}; + const products = [ { ...PRODUCT_LINKS.bridge, @@ -69,6 +79,20 @@ const socials = [ }, ]; +const bridgeRoutes = [ + "Arbitrum", + "Optimism", + "Linea", + "Polygon", + "Base", + "World Chain", + "zkSync", +].map((chain) => ({ + href: `https://app.across.to/${chain.toLowerCase().replaceAll(" ", "")}`, + label: `Bridge to ${chain}`, + highlightLink: true, +})); + const information = [ { ...INFORMATION_LINKS.blog, @@ -97,10 +121,11 @@ export function Footer() {
-
+
+
@@ -119,15 +144,16 @@ export function Footer() { function FooterBox(props: { label: string; - items: typeof products | typeof socials | typeof information; + items: LinkType[]; useExternalLinks?: boolean; + compressed?: boolean; }) { return (
{props.label}
-
+
{props.items.map((item) => (
{props.useExternalLinks && !item.href.startsWith("/") ? ( @@ -146,18 +172,23 @@ function FooterBox(props: { ); } -function FooterBoxItem(props: { - item: - | (typeof products)[number] - | (typeof socials)[number] - | (typeof information)[number]; -}) { +function FooterBoxItem(props: { item: LinkType }) { + const Icon = props.item.Icon; return (
- - - -
{props.item.label}
+ {Icon && ( + + + + )} +
+ {props.item.label} +
); }