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
+41
-52
@@ -1,12 +1,14 @@
|
||||
import { Suspense } from "react"
|
||||
import { COUNTRIES, countryTheme } from "@/lib/countries"
|
||||
import { countryTheme } from "@/lib/countries"
|
||||
import { getArmyFeed } from "@/lib/lokilab-feed"
|
||||
import { getCurrentMember } from "@/lib/member-auth"
|
||||
import { listFollowedPicks } from "@/lib/follows"
|
||||
import { resolveCountry } from "@/lib/country-pref"
|
||||
import { LotteryResultsPanel } from "@/components/lottery-results-panel"
|
||||
import { AppHeader } from "@/components/app-header"
|
||||
import { LotteryStrip } from "@/components/lottery-strip"
|
||||
import { Hero } from "@/components/hero"
|
||||
import { SideRail } from "@/components/side-rail"
|
||||
import { Flag } from "@/components/flag"
|
||||
import { Skeleton } from "@/components/ui/skeleton"
|
||||
|
||||
@@ -30,7 +32,6 @@ async function HomeContent() {
|
||||
const lotteries = feed.lotteries.filter((l) => l.country === activeCode)
|
||||
const totalWins = lotteries.reduce((sum, l) => sum + l.lifetime.wins, 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 follows = member ? await listFollowedPicks(member.id) : []
|
||||
@@ -38,69 +39,57 @@ async function HomeContent() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Hero
|
||||
armyTotal={feed.army.total}
|
||||
countryCount={COUNTRIES.length}
|
||||
totalWins={globalWins}
|
||||
isAuthenticated={!!member}
|
||||
/>
|
||||
<LotteryStrip lotteries={lotteries} />
|
||||
<div
|
||||
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">
|
||||
<h2 className="flex items-center gap-2 font-display text-2xl">
|
||||
<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
|
||||
<div className="min-w-0 space-y-4">
|
||||
<Hero isAuthenticated={!!member} />
|
||||
|
||||
<div className="overflow-hidden rounded-lg border border-border bg-card">
|
||||
<div className="flex items-center gap-2.5 border-b border-border bg-[#0b111d] px-4 py-2.5">
|
||||
<Flag code={theme.code} />
|
||||
<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>
|
||||
{lotteries.length > 0 ? (
|
||||
<LotteryResultsPanel
|
||||
lotteries={lotteries}
|
||||
country={activeCode}
|
||||
followedKeys={followedKeys}
|
||||
isAuthenticated={!!member}
|
||||
/>
|
||||
) : (
|
||||
<p className="py-14 text-center text-sm text-muted-foreground">
|
||||
Les loteries de {theme.name} arrivent bientôt dans l'univers de Loki.
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<p className="text-[11px] text-muted-foreground">
|
||||
Données fournies par LokiLab. Statistiques descriptives seulement — aucune garantie de gain.
|
||||
</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">
|
||||
<Stat value={feed.army.total.toLocaleString("fr-CA")} label="Armée (global)" />
|
||||
<Stat value={countryMembers.toLocaleString("fr-CA")} label={`Membres — ${theme.name}`} />
|
||||
<Stat value={totalTracked > 0 ? `${totalWins} / ${totalTracked}` : "—"} label="Grilles gagnantes" />
|
||||
</div>
|
||||
|
||||
{lotteries.length > 0 ? (
|
||||
<LotteryResultsPanel
|
||||
lotteries={lotteries}
|
||||
country={activeCode}
|
||||
followedKeys={followedKeys}
|
||||
isAuthenticated={!!member}
|
||||
/>
|
||||
) : (
|
||||
<div className="rounded-md border border-dashed border-border py-16 text-center text-sm text-muted-foreground">
|
||||
Les loteries de {theme.name} arrivent bientôt dans l'univers de Loki.
|
||||
</div>
|
||||
)}
|
||||
|
||||
<p className="text-[11px] text-muted-foreground">
|
||||
Données fournies par LokiLab. Statistiques descriptives seulement — aucune garantie de gain.
|
||||
</p>
|
||||
<Suspense fallback={<Skeleton className="h-72 w-full" />}>
|
||||
<SideRail armyTotal={feed.army.total} globalWins={globalWins} />
|
||||
</Suspense>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
function Stat({ value, label }: { value: string; label: string }) {
|
||||
return (
|
||||
<div className="flex items-baseline gap-1.5 whitespace-nowrap px-4 first:pl-0">
|
||||
<span className="font-semibold tabular-nums">{value}</span>
|
||||
<span className="text-xs text-muted-foreground">{label}</span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
function HomeSkeleton() {
|
||||
return (
|
||||
<div className="mx-auto w-full max-w-6xl space-y-3 px-4 py-6 sm:px-6">
|
||||
<Skeleton className="h-[520px] w-full" />
|
||||
<Skeleton className="h-11 w-full" />
|
||||
<Skeleton className="h-64 w-full" />
|
||||
<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]">
|
||||
<div className="space-y-4">
|
||||
<Skeleton className="h-44 w-full" />
|
||||
<Skeleton className="h-80 w-full" />
|
||||
</div>
|
||||
<Skeleton className="h-72 w-full" />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user