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>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
e97b2e54ad
commit
9996f7b823
@@ -43,7 +43,7 @@ export default async function LoginPage({
|
|||||||
{error && <p className="mt-4 text-xs text-destructive">{error}</p>}
|
{error && <p className="mt-4 text-xs text-destructive">{error}</p>}
|
||||||
|
|
||||||
<div className="mt-6">
|
<div className="mt-6">
|
||||||
<MemberAuthForm next={next} />
|
<MemberAuthForm next={next} initialMode={sp.mode === "inscription" ? "signup" : "login"} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="my-5 flex items-center gap-3 text-[11px] text-muted-foreground">
|
<div className="my-5 flex items-center gap-3 text-[11px] text-muted-foreground">
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { PerformanceChart } from "@/components/performance-chart"
|
|||||||
import { DrawTimeline } from "@/components/draw-timeline"
|
import { DrawTimeline } from "@/components/draw-timeline"
|
||||||
import { Badge } from "@/components/ui/badge"
|
import { Badge } from "@/components/ui/badge"
|
||||||
import { Flag } from "@/components/flag"
|
import { Flag } from "@/components/flag"
|
||||||
|
import { LotteryStrip } from "@/components/lottery-strip"
|
||||||
|
|
||||||
export const instant = false
|
export const instant = false
|
||||||
|
|
||||||
@@ -33,6 +34,7 @@ export default async function LotteryStatsPage({ params }: { params: Promise<{ i
|
|||||||
style={{ "--accent": theme.accent, "--accent-soft": theme.accentSoft } as React.CSSProperties}
|
style={{ "--accent": theme.accent, "--accent-soft": theme.accentSoft } as React.CSSProperties}
|
||||||
>
|
>
|
||||||
<AppHeader />
|
<AppHeader />
|
||||||
|
<LotteryStrip lotteries={feed.lotteries.filter((l) => l.country === entry.country)} activeId={entry.id} />
|
||||||
<div className="mx-auto w-full max-w-4xl flex-1 px-4 py-6 sm:px-6">
|
<div className="mx-auto w-full max-w-4xl flex-1 px-4 py-6 sm:px-6">
|
||||||
<div className="flex flex-wrap items-center gap-2">
|
<div className="flex flex-wrap items-center gap-2">
|
||||||
<h1 className="text-2xl font-bold tracking-tight">{entry.name}</h1>
|
<h1 className="text-2xl font-bold tracking-tight">{entry.name}</h1>
|
||||||
|
|||||||
+27
-38
@@ -1,12 +1,14 @@
|
|||||||
import { Suspense } from "react"
|
import { Suspense } from "react"
|
||||||
import { COUNTRIES, countryTheme } from "@/lib/countries"
|
import { countryTheme } from "@/lib/countries"
|
||||||
import { getArmyFeed } from "@/lib/lokilab-feed"
|
import { getArmyFeed } from "@/lib/lokilab-feed"
|
||||||
import { getCurrentMember } from "@/lib/member-auth"
|
import { getCurrentMember } from "@/lib/member-auth"
|
||||||
import { listFollowedPicks } from "@/lib/follows"
|
import { listFollowedPicks } from "@/lib/follows"
|
||||||
import { resolveCountry } from "@/lib/country-pref"
|
import { resolveCountry } from "@/lib/country-pref"
|
||||||
import { LotteryResultsPanel } from "@/components/lottery-results-panel"
|
import { LotteryResultsPanel } from "@/components/lottery-results-panel"
|
||||||
import { AppHeader } from "@/components/app-header"
|
import { AppHeader } from "@/components/app-header"
|
||||||
|
import { LotteryStrip } from "@/components/lottery-strip"
|
||||||
import { Hero } from "@/components/hero"
|
import { Hero } from "@/components/hero"
|
||||||
|
import { SideRail } from "@/components/side-rail"
|
||||||
import { Flag } from "@/components/flag"
|
import { Flag } from "@/components/flag"
|
||||||
import { Skeleton } from "@/components/ui/skeleton"
|
import { Skeleton } from "@/components/ui/skeleton"
|
||||||
|
|
||||||
@@ -30,7 +32,6 @@ async function HomeContent() {
|
|||||||
const lotteries = feed.lotteries.filter((l) => l.country === activeCode)
|
const lotteries = feed.lotteries.filter((l) => l.country === activeCode)
|
||||||
const totalWins = lotteries.reduce((sum, l) => sum + l.lifetime.wins, 0)
|
const totalWins = lotteries.reduce((sum, l) => sum + l.lifetime.wins, 0)
|
||||||
const totalTracked = lotteries.reduce((sum, l) => sum + l.lifetime.picksTracked, 0)
|
const totalTracked = lotteries.reduce((sum, l) => sum + l.lifetime.picksTracked, 0)
|
||||||
const countryMembers = feed.army.byCountry[activeCode] ?? 0
|
|
||||||
const globalWins = feed.lotteries.reduce((sum, l) => sum + l.lifetime.wins, 0)
|
const globalWins = feed.lotteries.reduce((sum, l) => sum + l.lifetime.wins, 0)
|
||||||
|
|
||||||
const follows = member ? await listFollowedPicks(member.id) : []
|
const follows = member ? await listFollowedPicks(member.id) : []
|
||||||
@@ -38,33 +39,22 @@ async function HomeContent() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Hero
|
<LotteryStrip lotteries={lotteries} />
|
||||||
armyTotal={feed.army.total}
|
|
||||||
countryCount={COUNTRIES.length}
|
|
||||||
totalWins={globalWins}
|
|
||||||
isAuthenticated={!!member}
|
|
||||||
/>
|
|
||||||
<div
|
<div
|
||||||
style={{ "--accent": theme.accent, "--accent-soft": theme.accentSoft } as React.CSSProperties}
|
style={{ "--accent": theme.accent, "--accent-soft": theme.accentSoft } as React.CSSProperties}
|
||||||
className="mx-auto w-full max-w-6xl flex-1 space-y-3 px-4 py-6 sm:px-6"
|
className="mx-auto grid w-full max-w-6xl flex-1 grid-cols-1 gap-4 px-4 py-4 sm:px-6 lg:grid-cols-[1fr_300px]"
|
||||||
>
|
>
|
||||||
<div className="flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1">
|
<div className="min-w-0 space-y-4">
|
||||||
<h2 className="flex items-center gap-2 font-display text-2xl">
|
<Hero isAuthenticated={!!member} />
|
||||||
<Flag code={theme.code} className="h-[18px] w-[27px]" />
|
|
||||||
{theme.name}
|
|
||||||
</h2>
|
|
||||||
<p className="text-xs text-muted-foreground">
|
|
||||||
{lotteries.length} loterie{lotteries.length === 1 ? "" : "s"} suivie
|
|
||||||
{lotteries.length === 1 ? "" : "s"} · changez de pays en haut à droite
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="flex h-11 items-center divide-x divide-border overflow-x-auto rounded-md border border-border bg-panel px-4 text-sm">
|
<div className="overflow-hidden rounded-lg border border-border bg-card">
|
||||||
<Stat value={feed.army.total.toLocaleString("fr-CA")} label="Armée (global)" />
|
<div className="flex items-center gap-2.5 border-b border-border bg-[#0b111d] px-4 py-2.5">
|
||||||
<Stat value={countryMembers.toLocaleString("fr-CA")} label={`Membres — ${theme.name}`} />
|
<Flag code={theme.code} />
|
||||||
<Stat value={totalTracked > 0 ? `${totalWins} / ${totalTracked}` : "—"} label="Grilles gagnantes" />
|
<h2 className="text-sm font-semibold">Derniers tirages — {theme.name}</h2>
|
||||||
|
<span className="ml-auto text-xs text-muted-foreground">
|
||||||
|
{totalTracked > 0 ? `Loki : ${totalWins}/${totalTracked} grilles gagnantes` : `${lotteries.length} loteries`}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{lotteries.length > 0 ? (
|
{lotteries.length > 0 ? (
|
||||||
<LotteryResultsPanel
|
<LotteryResultsPanel
|
||||||
lotteries={lotteries}
|
lotteries={lotteries}
|
||||||
@@ -73,34 +63,33 @@ async function HomeContent() {
|
|||||||
isAuthenticated={!!member}
|
isAuthenticated={!!member}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<div className="rounded-md border border-dashed border-border py-16 text-center text-sm text-muted-foreground">
|
<p className="py-14 text-center text-sm text-muted-foreground">
|
||||||
Les loteries de {theme.name} arrivent bientôt dans l'univers de Loki.
|
Les loteries de {theme.name} arrivent bientôt dans l'univers de Loki.
|
||||||
</div>
|
</p>
|
||||||
)}
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
<p className="text-[11px] text-muted-foreground">
|
<p className="text-[11px] text-muted-foreground">
|
||||||
Données fournies par LokiLab. Statistiques descriptives seulement — aucune garantie de gain.
|
Données fournies par LokiLab. Statistiques descriptives seulement — aucune garantie de gain.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
function Stat({ value, label }: { value: string; label: string }) {
|
<Suspense fallback={<Skeleton className="h-72 w-full" />}>
|
||||||
return (
|
<SideRail armyTotal={feed.army.total} globalWins={globalWins} />
|
||||||
<div className="flex items-baseline gap-1.5 whitespace-nowrap px-4 first:pl-0">
|
</Suspense>
|
||||||
<span className="font-semibold tabular-nums">{value}</span>
|
|
||||||
<span className="text-xs text-muted-foreground">{label}</span>
|
|
||||||
</div>
|
</div>
|
||||||
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function HomeSkeleton() {
|
function HomeSkeleton() {
|
||||||
return (
|
return (
|
||||||
<div className="mx-auto w-full max-w-6xl space-y-3 px-4 py-6 sm:px-6">
|
<div className="mx-auto grid w-full max-w-6xl grid-cols-1 gap-4 px-4 py-4 sm:px-6 lg:grid-cols-[1fr_300px]">
|
||||||
<Skeleton className="h-[520px] w-full" />
|
<div className="space-y-4">
|
||||||
<Skeleton className="h-11 w-full" />
|
<Skeleton className="h-44 w-full" />
|
||||||
<Skeleton className="h-64 w-full" />
|
<Skeleton className="h-80 w-full" />
|
||||||
|
</div>
|
||||||
|
<Skeleton className="h-72 w-full" />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
+23
-14
@@ -9,13 +9,31 @@ import { resolveCountry } from "@/lib/country-pref"
|
|||||||
|
|
||||||
async function CountrySlot() {
|
async function CountrySlot() {
|
||||||
const member = await getCurrentMember()
|
const member = await getCurrentMember()
|
||||||
return <CountrySwitcher active={await resolveCountry(member)} />
|
return <CountrySwitcher active={await resolveCountry(member)} compact />
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Two stacked bars, 1xbet-style: a thin utility bar (country, auth), then the main bar (logo, nav). */
|
||||||
export function AppHeader() {
|
export function AppHeader() {
|
||||||
return (
|
return (
|
||||||
<div className="sticky top-0 z-30 h-14 border-b border-border bg-background/85 backdrop-blur">
|
<header className="sticky top-0 z-30 border-b border-border bg-background/95 backdrop-blur">
|
||||||
<div className="mx-auto flex h-full max-w-6xl items-center gap-6 px-4 sm:px-6">
|
<div className="border-b border-border/60 bg-[#0b111d]">
|
||||||
|
<div className="mx-auto flex h-9 max-w-6xl items-center px-4 text-xs sm:px-6">
|
||||||
|
<p className="hidden text-muted-foreground md:block">
|
||||||
|
Pronostics & statistiques de loterie — l'univers de Loki
|
||||||
|
</p>
|
||||||
|
<div className="ml-auto flex items-center gap-2.5">
|
||||||
|
<Suspense fallback={<Skeleton className="h-7 w-24 rounded" />}>
|
||||||
|
<CountrySlot />
|
||||||
|
</Suspense>
|
||||||
|
<span aria-hidden className="h-4 w-px bg-border" />
|
||||||
|
<Suspense fallback={<Skeleton className="h-7 w-32 rounded" />}>
|
||||||
|
<UserMenu />
|
||||||
|
</Suspense>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="mx-auto flex h-14 max-w-6xl items-center gap-7 px-4 sm:px-6">
|
||||||
<Link href="/" className="flex shrink-0 items-center gap-2.5">
|
<Link href="/" className="flex shrink-0 items-center gap-2.5">
|
||||||
<Image src="/lokilab/ui/loki-mark.svg" alt="" aria-hidden="true" width={30} height={30} />
|
<Image src="/lokilab/ui/loki-mark.svg" alt="" aria-hidden="true" width={30} height={30} />
|
||||||
<span className="font-display text-xl text-foreground">
|
<span className="font-display text-xl text-foreground">
|
||||||
@@ -23,7 +41,7 @@ export function AppHeader() {
|
|||||||
</span>
|
</span>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
<nav className="hidden items-center gap-5 text-sm text-muted-foreground sm:flex">
|
<nav className="flex items-center gap-5 text-sm font-medium text-muted-foreground">
|
||||||
<Link href="/" className="transition-colors hover:text-gold">
|
<Link href="/" className="transition-colors hover:text-gold">
|
||||||
Résultats
|
Résultats
|
||||||
</Link>
|
</Link>
|
||||||
@@ -31,16 +49,7 @@ export function AppHeader() {
|
|||||||
Classement
|
Classement
|
||||||
</Link>
|
</Link>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<div className="ml-auto flex items-center gap-3">
|
|
||||||
<Suspense fallback={<Skeleton className="h-9 w-28 rounded-md" />}>
|
|
||||||
<CountrySlot />
|
|
||||||
</Suspense>
|
|
||||||
<Suspense fallback={<Skeleton className="h-8 w-8 rounded-full" />}>
|
|
||||||
<UserMenu />
|
|
||||||
</Suspense>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</header>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import {
|
|||||||
import { cn } from "@/lib/utils"
|
import { cn } from "@/lib/utils"
|
||||||
import { Flag } from "@/components/flag"
|
import { Flag } from "@/components/flag"
|
||||||
|
|
||||||
export function CountrySwitcher({ active }: { active: string }) {
|
export function CountrySwitcher({ active, compact }: { active: string; compact?: boolean }) {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const [pending, startTransition] = useTransition()
|
const [pending, startTransition] = useTransition()
|
||||||
const current = countryTheme(active)
|
const current = countryTheme(active)
|
||||||
@@ -34,7 +34,10 @@ export function CountrySwitcher({ active }: { active: string }) {
|
|||||||
<DropdownMenuTrigger
|
<DropdownMenuTrigger
|
||||||
aria-label={`Pays : ${current.name}. Changer de pays`}
|
aria-label={`Pays : ${current.name}. Changer de pays`}
|
||||||
className={cn(
|
className={cn(
|
||||||
"flex h-9 items-center gap-2 rounded-md border border-gold/30 bg-card/70 px-3 text-sm font-medium outline-none transition-colors hover:border-gold/60 focus-visible:ring-2 focus-visible:ring-ring",
|
"flex items-center gap-2 rounded border font-medium outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring",
|
||||||
|
compact
|
||||||
|
? "h-7 border-transparent px-2 text-xs hover:bg-panel-hover"
|
||||||
|
: "h-9 border-gold/30 bg-card/70 px-3 text-sm hover:border-gold/60",
|
||||||
pending && "opacity-60"
|
pending && "opacity-60"
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
|||||||
+22
-70
@@ -1,92 +1,44 @@
|
|||||||
import Image from "next/image"
|
import Image from "next/image"
|
||||||
import Link from "next/link"
|
import Link from "next/link"
|
||||||
import { Users, Trophy, Globe } from "lucide-react"
|
|
||||||
import { Button } from "@/components/ui/button"
|
import { Button } from "@/components/ui/button"
|
||||||
|
|
||||||
export function Hero({
|
/** Compact promo banner, 1xbet-style: short, wide, one message and one CTA — data stays above the fold. */
|
||||||
armyTotal,
|
export function Hero({ isAuthenticated }: { isAuthenticated: boolean }) {
|
||||||
countryCount,
|
|
||||||
totalWins,
|
|
||||||
isAuthenticated,
|
|
||||||
}: {
|
|
||||||
armyTotal: number
|
|
||||||
countryCount: number
|
|
||||||
totalWins: number
|
|
||||||
isAuthenticated: boolean
|
|
||||||
}) {
|
|
||||||
return (
|
return (
|
||||||
<section className="relative isolate overflow-hidden border-b border-border">
|
<section className="relative isolate overflow-hidden rounded-lg border border-gold/25">
|
||||||
<picture className="absolute inset-0 -z-20">
|
|
||||||
<source media="(max-width: 767px)" srcSet="/lokilab/backgrounds/observatory-mobile.webp" />
|
|
||||||
<img
|
<img
|
||||||
src="/lokilab/backgrounds/observatory-desktop.webp"
|
src="/lokilab/backgrounds/observatory-desktop.webp"
|
||||||
alt=""
|
alt=""
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
className="h-full w-full object-cover"
|
className="absolute inset-0 -z-20 h-full w-full object-cover object-[center_35%]"
|
||||||
/>
|
/>
|
||||||
</picture>
|
<div className="absolute inset-0 -z-10 bg-gradient-to-r from-background via-background/85 to-background/20" />
|
||||||
<div className="absolute inset-0 -z-10 bg-gradient-to-r from-background via-background/80 to-background/10" />
|
|
||||||
<div className="absolute inset-x-0 bottom-0 -z-10 h-40 bg-gradient-to-t from-background to-transparent" />
|
|
||||||
|
|
||||||
<div className="mx-auto grid min-h-[600px] max-w-6xl grid-cols-1 items-end gap-4 px-4 pt-10 sm:px-6 md:grid-cols-[1.1fr_0.9fr] md:items-center md:pt-0">
|
<div className="flex min-h-[176px] items-center justify-between gap-4 pl-5 sm:pl-8">
|
||||||
<div className="pb-4 md:py-16">
|
<div className="py-5">
|
||||||
<p className="text-xs font-semibold uppercase tracking-[0.2em] text-mint">L'armée de Loki</p>
|
<p className="text-[11px] font-semibold uppercase tracking-[0.2em] text-mint">L'armée de Loki</p>
|
||||||
<h1 className="mt-3 font-display text-4xl leading-[1.08] text-foreground sm:text-5xl lg:text-6xl">
|
<h1 className="mt-1.5 font-display text-2xl leading-tight sm:text-3xl">
|
||||||
Loki lit les tirages.
|
Loki lit les tirages. <span className="text-gold">Suivez ses choix.</span>
|
||||||
<br />
|
|
||||||
<span className="text-gold">Vous décidez de le suivre.</span>
|
|
||||||
</h1>
|
</h1>
|
||||||
<p className="mt-5 max-w-md text-base leading-relaxed text-muted-foreground">
|
<p className="mt-1.5 max-w-md text-sm text-muted-foreground">
|
||||||
Résultats, statistiques et pronostics de loterie, pays par pays. Rejoignez l'armée,
|
Suivez ses pronostics, grimpez au classement — gratuit.
|
||||||
suivez les choix de Loki et grimpez au classement.
|
|
||||||
</p>
|
</p>
|
||||||
|
<Button asChild size="sm" className="mt-3.5 h-9 px-5 font-semibold">
|
||||||
<div className="mt-7 flex flex-wrap items-center gap-3">
|
<Link href={isAuthenticated ? "/classement" : "/connexion?mode=inscription"}>
|
||||||
{!isAuthenticated && (
|
{isAuthenticated ? "Voir le classement" : "Rejoindre l'armée"}
|
||||||
<Button asChild size="lg" className="h-11 px-6 font-semibold shadow-[0_0_24px_rgba(244,199,107,0.35)]">
|
</Link>
|
||||||
<Link href="/connexion">Rejoindre l'armée</Link>
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
<Button
|
|
||||||
asChild
|
|
||||||
variant="outline"
|
|
||||||
size="lg"
|
|
||||||
className="h-11 border-gold/40 bg-background/40 px-6 backdrop-blur hover:bg-gold/10"
|
|
||||||
>
|
|
||||||
<Link href="/classement">Voir le classement</Link>
|
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="mt-10 grid max-w-lg grid-cols-3 gap-3">
|
|
||||||
<HeroStat icon={Users} value={armyTotal.toLocaleString("fr-CA")} label="Membres" />
|
|
||||||
<HeroStat icon={Globe} value={countryCount.toString()} label="Pays" />
|
|
||||||
<HeroStat icon={Trophy} value={totalWins.toString()} label="Grilles gagnées" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="relative flex justify-center md:justify-end">
|
|
||||||
<div className="absolute bottom-10 h-64 w-64 rounded-full bg-gold/20 blur-3xl" />
|
|
||||||
<Image
|
<Image
|
||||||
src="/lokilab/mascots/loki-welcome.webp"
|
src="/lokilab/mascots/loki-welcome-320.webp"
|
||||||
alt="Loki, la mascotte de LokiLoto, salue de la main"
|
alt=""
|
||||||
width={640}
|
aria-hidden="true"
|
||||||
height={960}
|
width={320}
|
||||||
|
height={480}
|
||||||
priority
|
priority
|
||||||
sizes="(max-width: 767px) 260px, 420px"
|
className="hidden h-[176px] w-auto self-end object-cover object-top sm:block sm:mr-6"
|
||||||
className="relative h-[340px] w-auto drop-shadow-[0_20px_40px_rgba(0,0,0,0.6)] md:h-[560px]"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</section>
|
</section>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function HeroStat({ icon: Icon, value, label }: { icon: typeof Users; value: string; label: string }) {
|
|
||||||
return (
|
|
||||||
<div className="rounded-lg border border-gold/20 bg-card/60 px-3 py-3 backdrop-blur">
|
|
||||||
<Icon className="h-4 w-4 text-gold" />
|
|
||||||
<p className="mt-2 font-display text-2xl leading-none text-foreground tabular-nums">{value}</p>
|
|
||||||
<p className="mt-1 text-[11px] text-muted-foreground">{label}</p>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ export function LotteryResultsPanel({
|
|||||||
isAuthenticated: boolean
|
isAuthenticated: boolean
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<div className="overflow-hidden rounded-md border border-border/60 bg-panel">
|
<div>
|
||||||
<div className="hidden sm:grid grid-cols-[28px_160px_1fr_1fr_72px_120px] gap-3 border-b border-border/60 px-3 py-2 text-xs font-medium uppercase tracking-wide text-muted-foreground">
|
<div className="hidden sm:grid grid-cols-[28px_160px_1fr_1fr_72px_120px] gap-3 border-b border-border/60 px-3 py-2 text-[11px] font-medium uppercase tracking-wide text-muted-foreground">
|
||||||
<span />
|
<span />
|
||||||
<span>Loterie</span>
|
<span>Loterie</span>
|
||||||
<span>Résultat officiel</span>
|
<span>Résultat officiel</span>
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
import Link from "next/link"
|
||||||
|
import { Clover, Crown, Dices, Gem, LayoutGrid, type LucideIcon } from "lucide-react"
|
||||||
|
import { cn } from "@/lib/utils"
|
||||||
|
import type { LotteryFeedEntry } from "@/lib/lokilab-feed"
|
||||||
|
|
||||||
|
const ICONS: Record<string, LucideIcon> = {
|
||||||
|
"lotto-max": Crown,
|
||||||
|
"lotto-649": Clover,
|
||||||
|
"daily-grand": Gem,
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Horizontal icon strip under the header — the 1xbet sports-strip pattern, one tile per lottery. */
|
||||||
|
export function LotteryStrip({ lotteries, activeId }: { lotteries: LotteryFeedEntry[]; activeId?: string }) {
|
||||||
|
return (
|
||||||
|
<div className="border-b border-border bg-card/70">
|
||||||
|
<div className="mx-auto flex max-w-6xl items-stretch overflow-x-auto px-2 sm:px-4 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden">
|
||||||
|
<StripItem href="/" icon={LayoutGrid} label="Tous" active={!activeId} />
|
||||||
|
{lotteries.map((l) => (
|
||||||
|
<StripItem
|
||||||
|
key={l.id}
|
||||||
|
href={`/loterie/${l.id}`}
|
||||||
|
icon={ICONS[l.id] ?? Dices}
|
||||||
|
label={shortName(l.name)}
|
||||||
|
active={activeId === l.id}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function StripItem({
|
||||||
|
href,
|
||||||
|
icon: Icon,
|
||||||
|
label,
|
||||||
|
active,
|
||||||
|
}: {
|
||||||
|
href: string
|
||||||
|
icon: LucideIcon
|
||||||
|
label: string
|
||||||
|
active?: boolean
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<Link
|
||||||
|
href={href}
|
||||||
|
aria-current={active ? "page" : undefined}
|
||||||
|
className={cn(
|
||||||
|
"flex w-[86px] shrink-0 flex-col items-center gap-1.5 border-b-2 px-2 pb-2.5 pt-3 text-center transition-colors",
|
||||||
|
active
|
||||||
|
? "border-gold bg-gold/5 text-gold"
|
||||||
|
: "border-transparent text-muted-foreground hover:bg-panel-hover/50 hover:text-foreground"
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<Icon className="h-5 w-5" />
|
||||||
|
<span className="w-full truncate text-[11px] leading-tight">{label}</span>
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function shortName(name: string) {
|
||||||
|
return name.replace(" (Daily Grand)", "").replace("Quotidienne ", "Quot. ")
|
||||||
|
}
|
||||||
@@ -9,8 +9,8 @@ import { cn } from "@/lib/utils"
|
|||||||
|
|
||||||
const INITIAL: MemberAuthState = { ok: false, message: "" }
|
const INITIAL: MemberAuthState = { ok: false, message: "" }
|
||||||
|
|
||||||
export function MemberAuthForm({ next }: { next: string }) {
|
export function MemberAuthForm({ next, initialMode = "login" }: { next: string; initialMode?: "login" | "signup" }) {
|
||||||
const [mode, setMode] = useState<"login" | "signup">("login")
|
const [mode, setMode] = useState<"login" | "signup">(initialMode)
|
||||||
const [loginState, loginAction, loginPending] = useActionState(loginWithPassword, INITIAL)
|
const [loginState, loginAction, loginPending] = useActionState(loginWithPassword, INITIAL)
|
||||||
const [signupState, signupActionFn, signupPending] = useActionState(signupWithPassword, INITIAL)
|
const [signupState, signupActionFn, signupPending] = useActionState(signupWithPassword, INITIAL)
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
import Link from "next/link"
|
||||||
|
import { Trophy, Users } from "lucide-react"
|
||||||
|
import { leaderboard } from "@/lib/follows"
|
||||||
|
|
||||||
|
/** Right rail, 1xbet "bet slip" position — here the live leaderboard and army stats. */
|
||||||
|
export async function SideRail({ armyTotal, globalWins }: { armyTotal: number; globalWins: number }) {
|
||||||
|
const top = await leaderboard(5)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<aside className="space-y-3">
|
||||||
|
<div className="overflow-hidden rounded-lg border border-border bg-card">
|
||||||
|
<div className="flex items-center gap-2 border-b border-border bg-gold/10 px-4 py-2.5">
|
||||||
|
<Trophy className="h-4 w-4 text-gold" />
|
||||||
|
<h2 className="text-sm font-semibold">Classement</h2>
|
||||||
|
</div>
|
||||||
|
{top.length === 0 ? (
|
||||||
|
<p className="px-4 py-5 text-xs leading-relaxed text-muted-foreground">
|
||||||
|
Personne au classement pour l'instant. Suivez un choix de Loki (★) pour y entrer.
|
||||||
|
</p>
|
||||||
|
) : (
|
||||||
|
<ol className="divide-y divide-border/60">
|
||||||
|
{top.map((s, i) => (
|
||||||
|
<li key={s.userId} className="flex items-center gap-3 px-4 py-2 text-sm">
|
||||||
|
<span className="w-4 text-xs text-muted-foreground tabular-nums">{i + 1}</span>
|
||||||
|
<span className="flex-1 truncate">{s.displayName}</span>
|
||||||
|
<span className="font-semibold tabular-nums text-gold">{(s.winRate * 100).toFixed(0)}%</span>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ol>
|
||||||
|
)}
|
||||||
|
<Link href="/classement" className="block border-t border-border px-4 py-2 text-center text-xs text-gold hover:bg-gold/5">
|
||||||
|
Voir tout le classement
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="grid grid-cols-2 gap-3">
|
||||||
|
<RailStat icon={Users} value={armyTotal.toLocaleString("fr-CA")} label="Membres" />
|
||||||
|
<RailStat icon={Trophy} value={globalWins.toString()} label="Grilles gagnées" />
|
||||||
|
</div>
|
||||||
|
</aside>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function RailStat({ icon: Icon, value, label }: { icon: typeof Users; value: string; label: string }) {
|
||||||
|
return (
|
||||||
|
<div className="rounded-lg border border-border bg-card px-3 py-3">
|
||||||
|
<Icon className="h-4 w-4 text-gold" />
|
||||||
|
<p className="mt-1.5 font-display text-xl leading-none tabular-nums">{value}</p>
|
||||||
|
<p className="mt-1 text-[11px] text-muted-foreground">{label}</p>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -15,9 +15,14 @@ export async function UserMenu() {
|
|||||||
|
|
||||||
if (!member) {
|
if (!member) {
|
||||||
return (
|
return (
|
||||||
<Button asChild size="sm">
|
<div className="flex items-center gap-1.5">
|
||||||
|
<Button asChild size="sm" variant="ghost" className="h-7 px-3 text-xs">
|
||||||
<Link href="/connexion">Connexion</Link>
|
<Link href="/connexion">Connexion</Link>
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button asChild size="sm" className="h-7 px-3 text-xs font-semibold">
|
||||||
|
<Link href="/connexion?mode=inscription">Inscription</Link>
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -26,8 +31,9 @@ export async function UserMenu() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<DropdownMenu>
|
<DropdownMenu>
|
||||||
<DropdownMenuTrigger className="flex items-center gap-2 rounded-full outline-none focus-visible:ring-2 focus-visible:ring-ring">
|
<DropdownMenuTrigger className="flex items-center gap-2 rounded-full text-xs outline-none focus-visible:ring-2 focus-visible:ring-ring">
|
||||||
<Avatar className="h-8 w-8">
|
<span className="hidden text-muted-foreground sm:inline">{displayName}</span>
|
||||||
|
<Avatar className="h-6 w-6">
|
||||||
<AvatarImage src={member.avatarUrl ?? undefined} alt="" />
|
<AvatarImage src={member.avatarUrl ?? undefined} alt="" />
|
||||||
<AvatarFallback>{initial}</AvatarFallback>
|
<AvatarFallback>{initial}</AvatarFallback>
|
||||||
</Avatar>
|
</Avatar>
|
||||||
|
|||||||
Reference in New Issue
Block a user