Files
Nazim KriandClaude Opus 5.5 9996f7b823 Restructure navigation after 1xbet: utility bar, lottery strip, right rail
User feedback: still ugly, the 1xbet navigation was never actually
reproduced. Now follows its structure:
- thin utility bar on top (country picker, Connexion + Inscription)
  above the main bar (logo, nav)
- horizontal icon strip of the country's lotteries under the header,
  with the active one underlined in gold
- compact promo banner instead of a full-height hero, so results stay
  above the fold
- right rail in the bet-slip position: top-5 leaderboard and army stats

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 15:41:16 -04:00

91 lines
3.8 KiB
TypeScript

import type { Metadata } from "next"
import Link from "next/link"
import { redirect } from "next/navigation"
import { getCurrentMember } from "@/lib/member-auth"
import { MemberAuthForm } from "@/components/member-auth-form"
import { LokiMark } from "@/components/loki-mark"
export const metadata: Metadata = { title: "Connexion — LokiLoto" }
export const instant = false
const ERROR_FR: Record<string, string> = {
oauth_state: "La connexion a expiré ou a été interrompue. Réessayez.",
oauth_failed: "La connexion avec Google a échoué. Réessayez.",
google_not_configured: "La connexion Google n'est pas encore activée sur ce site.",
}
export default async function LoginPage({
searchParams,
}: {
searchParams: Promise<Record<string, string | string[] | undefined>>
}) {
const member = await getCurrentMember()
if (member) redirect("/profil")
const sp = await searchParams
const errorKey = typeof sp.error === "string" ? sp.error : null
const error = errorKey ? (ERROR_FR[errorKey] ?? "Une erreur est survenue. Réessayez.") : null
const next = typeof sp.next === "string" && sp.next.startsWith("/") ? sp.next : "/profil"
return (
<main className="flex flex-1 items-center justify-center px-4 py-12">
<div className="w-full max-w-sm">
<Link href="/" className="mb-8 inline-flex items-center gap-2">
<LokiMark className="h-8 w-8 text-accent" />
<span className="text-lg font-bold tracking-tight">LokiLoto</span>
</Link>
<h1 className="text-xl font-bold tracking-tight">Connexion</h1>
<p className="mt-1 text-sm text-muted-foreground">
Suivez les choix de Loki, apparaissez au classement, gardez votre pays favori.
</p>
{error && <p className="mt-4 text-xs text-destructive">{error}</p>}
<div className="mt-6">
<MemberAuthForm next={next} initialMode={sp.mode === "inscription" ? "signup" : "login"} />
</div>
<div className="my-5 flex items-center gap-3 text-[11px] text-muted-foreground">
<span className="h-px flex-1 bg-border" />
ou
<span className="h-px flex-1 bg-border" />
</div>
<a
href={`/api/auth/google?next=${encodeURIComponent(next)}`}
className="flex h-9 w-full items-center justify-center gap-3 rounded-md border border-border bg-panel text-sm font-medium transition-colors hover:bg-panel-hover"
>
<svg viewBox="0 0 24 24" className="h-4 w-4 shrink-0" aria-hidden="true">
<path
fill="#4285F4"
d="M23.52 12.27c0-.85-.07-1.47-.23-2.12H12v3.85h6.6c-.13 1.1-.86 2.76-2.47 3.87l-.02.15 3.59 2.78.25.02c2.28-2.1 3.57-5.2 3.57-8.55"
/>
<path
fill="#34A853"
d="M12 24c3.24 0 5.95-1.07 7.93-2.91l-3.78-2.93c-1.02.7-2.4 1.19-4.15 1.19-3.18 0-5.88-2.1-6.84-5l-.14.01-3.73 2.89-.05.13C3.21 21.3 7.26 24 12 24"
/>
<path
fill="#FBBC05"
d="M5.16 14.35A7.3 7.3 0 0 1 4.75 12c0-.81.14-1.6.4-2.35l-.01-.16-3.78-2.94-.12.06A11.97 11.97 0 0 0 0 12c0 1.93.46 3.76 1.24 5.39l3.92-3.04"
/>
<path
fill="#EA4335"
d="M12 4.75c2.25 0 3.77.97 4.64 1.78l3.39-3.31C17.94 1.19 15.24 0 12 0 7.26 0 3.21 2.7 1.24 6.61l3.91 3.04c.97-2.9 3.67-5 6.85-5"
/>
</svg>
Continuer avec Google
</a>
<p className="mt-6 text-[11px] leading-relaxed text-muted-foreground">
Un compte LokiLoto sert à suivre vos pronostics et apparaître au classement. Aucun billet
n&apos;est vendu, aucun argent ne transite par ce site.
</p>
<Link href="/" className="mt-6 inline-block text-xs text-muted-foreground hover:text-foreground">
← Retour au site
</Link>
</div>
</main>
)
}