Detect checkout email collisions and show login state in the navbar

Registering with an email that already has an account previously just
failed with a generic error and no clear next step. registerCustomer()
now flags emailExists specifically, and checkout switches straight to the
login toggle (email pre-filled, scrolled into view) instead. The account
icon also gets a small underline while logged in, matching the nav links'
active-state styling — it was otherwise the only nav element that gave no
visual signal of session state.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Marco
2026-07-22 08:26:00 +00:00
parent f0df359db4
commit ec75a480bd
4 changed files with 58 additions and 6 deletions
+6 -1
View File
@@ -107,13 +107,18 @@ function AccountLink({ variant }: { variant: "icon" | "mobile" }) {
return (
<Link
href={href}
aria-label={loggedIn ? "Mein Konto" : "Anmelden"}
aria-label={loggedIn ? "Mein Konto (eingeloggt)" : "Anmelden"}
className="relative flex h-11 w-11 items-center justify-center shrink-0 active:scale-[0.9] transition-transform"
>
<svg viewBox="0 0 24 24" className="h-6 w-6 text-text-primary" fill="none" aria-hidden="true">
<circle cx="12" cy="8" r="3.6" stroke="currentColor" strokeWidth="1.8" />
<path d="M4.5 20c1.2-4 4-6 7.5-6s6.3 2 7.5 6" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" />
</svg>
{/* Only real "am I logged in?" signal on the site outside /konto
itself — same brand-colored underline language as the desktop
nav links' active-state indicator, so it reads as consistent
rather than a new visual idiom. */}
{loggedIn && <span aria-hidden className="absolute bottom-1 h-[2px] w-4 bg-brand rounded-full" />}
</Link>
);
}