site-footer.tsx 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import { LanguageLink } from "@/components/nav/language-link";
  2. import { Shortcut } from "@/components/nav/shortcut";
  3. import { siteConfig } from "@/config/site";
  4. import type { Locale } from "@/lib/i18n";
  5. import { getMessages } from "@/messages";
  6. /**
  7. * One step below the page, spanning its column with the text on the column's
  8. * text edge (see .site-footer). On phones it ends just clear of the floating nav.
  9. */
  10. export function SiteFooter({ lang }: { lang: Locale }) {
  11. const t = getMessages(lang);
  12. const links = [{ label: t.common.email, href: siteConfig.links.email }];
  13. return (
  14. <footer className="site-footer relative z-10 mx-auto w-full max-w-[1240px] px-3 pb-[calc(max(14px,env(safe-area-inset-bottom))+72px)] sm:px-6 sm:pb-9">
  15. <div className="mx-auto flex max-w-(--footer-col) flex-col gap-2.5 px-(--footer-inset) text-[12.5px] text-muted min-[480px]:flex-row min-[480px]:items-center min-[480px]:justify-between">
  16. <p>
  17. © {new Date().getFullYear()} {t.hero.name} · {t.common.location}
  18. <span className="max-sm:hidden">
  19. {" "}
  20. ·{" "}
  21. <kbd className="rounded-md border border-line px-1.5 py-0.5 font-sans text-[11px]">
  22. <Shortcut />
  23. </kbd>{" "}
  24. {t.footer.explore}
  25. </span>
  26. </p>
  27. <ul className="flex items-center gap-5">
  28. {links.map((l) => (
  29. <li key={l.label}>
  30. {/* Padding cancelled by margin: a bigger tap target, same layout. */}
  31. <a
  32. className="-mx-1.5 -my-2 inline-block px-1.5 py-2 transition-colors hover:text-ink"
  33. data-cursor={l.label}
  34. href={l.href}
  35. rel="noopener noreferrer"
  36. target={l.href.startsWith("http") ? "_blank" : undefined}
  37. >
  38. {l.label}
  39. </a>
  40. </li>
  41. ))}
  42. <li>
  43. <LanguageLink className="-mx-1.5 -my-2 inline-block px-1.5 py-2 transition-colors hover:text-ink" />
  44. </li>
  45. </ul>
  46. </div>
  47. </footer>
  48. );
  49. }