fix: scroll to top on locale switch and remove dashes from hero text
All checks were successful
CI / CD / test-build (push) Successful in 10m8s
CI / CD / deploy-dev (push) Has been skipped
CI / CD / deploy-production (push) Successful in 1m15s

- HeaderClient: track locale prop changes with useRef and call
  window.scrollTo on switch to reliably reset scroll position
- messages/en.json + de.json: replace em dash with comma and remove
  hyphens from Self-Hoster/Full-Stack in hero description

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-08 14:37:56 +01:00
parent 48a29cd872
commit aee811309b
3 changed files with 11 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
"use client";
import { useState, useEffect } from "react";
import { useState, useEffect, useRef } from "react";
import { SiGithub, SiLinkedin } from "react-icons/si";
import Link from "next/link";
import { usePathname, useSearchParams } from "next/navigation";
@@ -27,6 +27,14 @@ export default function HeaderClient({ locale, translations }: HeaderClientProps
const [scrolled, setScrolled] = useState(false);
const pathname = usePathname();
const searchParams = useSearchParams();
const prevLocale = useRef(locale);
useEffect(() => {
if (prevLocale.current !== locale) {
window.scrollTo({ top: 0, behavior: "instant" });
prevLocale.current = locale;
}
}, [locale]);
const isHome = pathname === `/${locale}` || pathname === `/${locale}/`;