site-footer.tsx 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 = [
  13. { label: "GitHub", href: siteConfig.links.github },
  14. { label: "LinkedIn", href: siteConfig.links.linkedin },
  15. { label: t.common.email, href: siteConfig.links.email },
  16. ];
  17. return (
  18. <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">
  19. <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">
  20. <p>
  21. © {new Date().getFullYear()} {siteConfig.author} · {t.common.location}
  22. <span className="max-sm:hidden">
  23. {" "}
  24. ·{" "}
  25. <kbd className="rounded-md border border-line px-1.5 py-0.5 font-sans text-[11px]">
  26. <Shortcut />
  27. </kbd>{" "}
  28. {t.footer.explore}
  29. </span>
  30. </p>
  31. <ul className="flex items-center gap-5">
  32. {links.map((l) => (
  33. <li key={l.label}>
  34. {/* Padding cancelled by margin: a bigger tap target, same layout. */}
  35. <a
  36. className="-mx-1.5 -my-2 inline-block px-1.5 py-2 transition-colors hover:text-ink"
  37. data-cursor={l.label}
  38. href={l.href}
  39. rel="noopener noreferrer"
  40. target={l.href.startsWith("http") ? "_blank" : undefined}
  41. >
  42. {l.label}
  43. </a>
  44. </li>
  45. ))}
  46. <li>
  47. <LanguageLink className="-mx-1.5 -my-2 inline-block px-1.5 py-2 transition-colors hover:text-ink" />
  48. </li>
  49. </ul>
  50. </div>
  51. </footer>
  52. );
  53. }