Add language switcher dropdown and persist manual locale choice.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
eric
2026-08-03 09:02:19 -05:00
parent af0a430864
commit 7453780e06
6 changed files with 96 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
"use client";
import Link from "next/link";
import { LanguageSwitcher } from "~/components/language-switcher";
import { useLocale } from "~/components/locale-provider";
export default function AboutPage() {
@@ -8,12 +9,18 @@ export default function AboutPage() {
return (
<div
className="flex min-h-dvh flex-col bg-[#f8f7fc] px-5 py-10"
className="relative flex min-h-dvh flex-col bg-[#f8f7fc] px-5 py-10"
style={{
paddingTop: "max(2.5rem, calc(1.5rem + var(--safe-top)))",
paddingBottom: "max(2.5rem, calc(1.5rem + var(--safe-bottom)))",
}}
>
<div
className="absolute right-4 z-10"
style={{ top: "max(1rem, calc(0.75rem + var(--safe-top)))" }}
>
<LanguageSwitcher />
</div>
<div className="mx-auto w-full max-w-md">
<h1 className="text-xl font-bold text-neutral-900">{t.about.title}</h1>
<p className="mt-4 text-sm leading-relaxed text-neutral-600">

View File

@@ -1,6 +1,7 @@
"use client";
import Link from "next/link";
import { LanguageSwitcher } from "~/components/language-switcher";
import { useLocale } from "~/components/locale-provider";
export default function ContactPage() {
@@ -8,12 +9,18 @@ export default function ContactPage() {
return (
<div
className="flex min-h-dvh flex-col bg-[#f8f7fc] px-5 py-10"
className="relative flex min-h-dvh flex-col bg-[#f8f7fc] px-5 py-10"
style={{
paddingTop: "max(2.5rem, calc(1.5rem + var(--safe-top)))",
paddingBottom: "max(2.5rem, calc(1.5rem + var(--safe-bottom)))",
}}
>
<div
className="absolute right-4 z-10"
style={{ top: "max(1rem, calc(0.75rem + var(--safe-top)))" }}
>
<LanguageSwitcher />
</div>
<div className="mx-auto w-full max-w-md">
<h1 className="text-xl font-bold text-neutral-900">{t.contact.title}</h1>
<p className="mt-4 text-sm leading-relaxed text-neutral-600">

View File

@@ -1,6 +1,7 @@
"use client";
import { Hero } from "~/components/sections/hero";
import { LanguageSwitcher } from "~/components/language-switcher";
import { useLocale } from "~/components/locale-provider";
export default function HomePage() {
@@ -12,6 +13,12 @@ export default function HomePage() {
className="flex min-h-dvh flex-col"
style={{ minHeight: "100dvh" }}
>
<div
className="absolute right-4 z-10"
style={{ top: "max(1rem, calc(0.75rem + var(--safe-top)))" }}
>
<LanguageSwitcher />
</div>
<main className="flex flex-1 flex-col">
<Hero />
</main>