Add a real hero landing section with large mascot, slogan, CTA
The homepage went straight into a dense dashboard with no brand identity up front — user feedback was blunt: "c'est quoi ça, j'ai demandé une belle landing page et interface." Adds a proper hero above the existing dashboard: a large, more detailed mascot illustration (LokiHeroMark, distinct from the small LokiMark used in the header), a real headline + tagline, "Rejoindre l'armée" / "Voir le classement" CTAs, and big-number stats (army size, country count, total wins). Brand-neutral gold accent, not tied to the selected country's color — the hero is identity, not data. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
c36b621d39
commit
8a45c331c3
+55
-45
@@ -6,6 +6,7 @@ import { listFollowedPicks } from "@/lib/follows"
|
||||
import { CountryNav, CountryNavMobile } from "@/components/country-nav"
|
||||
import { LotteryResultsPanel } from "@/components/lottery-results-panel"
|
||||
import { AppHeader } from "@/components/app-header"
|
||||
import { Hero } from "@/components/hero"
|
||||
import { Skeleton } from "@/components/ui/skeleton"
|
||||
|
||||
export const instant = false
|
||||
@@ -35,62 +36,71 @@ async function HomeContent({ activeCode }: { activeCode: string }) {
|
||||
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) : []
|
||||
const followedKeys = new Set(follows.map((f) => `${f.lotteryId}:${f.targetDrawDate}`))
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{ "--accent": theme.accent, "--accent-soft": theme.accentSoft } as React.CSSProperties}
|
||||
className="mx-auto w-full max-w-6xl flex-1 px-4 py-4 sm:px-6"
|
||||
>
|
||||
<div className="sm:hidden mb-3">
|
||||
<CountryNavMobile active={activeCode} />
|
||||
</div>
|
||||
<>
|
||||
<Hero
|
||||
armyTotal={feed.army.total}
|
||||
countryCount={COUNTRIES.length}
|
||||
totalWins={globalWins}
|
||||
isAuthenticated={!!member}
|
||||
/>
|
||||
<div
|
||||
style={{ "--accent": theme.accent, "--accent-soft": theme.accentSoft } as React.CSSProperties}
|
||||
className="mx-auto w-full max-w-6xl flex-1 px-4 py-4 sm:px-6"
|
||||
>
|
||||
<div className="sm:hidden mb-3">
|
||||
<CountryNavMobile active={activeCode} />
|
||||
</div>
|
||||
|
||||
<div className="flex gap-5">
|
||||
<aside className="hidden w-[200px] shrink-0 sm:block">
|
||||
<CountryNav active={activeCode} />
|
||||
</aside>
|
||||
<div className="flex gap-5">
|
||||
<aside className="hidden w-[200px] shrink-0 sm:block">
|
||||
<CountryNav active={activeCode} />
|
||||
</aside>
|
||||
|
||||
<div className="min-w-0 flex-1 space-y-3">
|
||||
<div className="flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1">
|
||||
<h1 className="text-[22px] font-bold tracking-tight">{theme.name}</h1>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{lotteries.length} loterie{lotteries.length === 1 ? "" : "s"} suivie
|
||||
{lotteries.length === 1 ? "" : "s"}
|
||||
<div className="min-w-0 flex-1 space-y-3">
|
||||
<div className="flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1">
|
||||
<h2 className="text-[22px] font-bold tracking-tight">{theme.name}</h2>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{lotteries.length} loterie{lotteries.length === 1 ? "" : "s"} suivie
|
||||
{lotteries.length === 1 ? "" : "s"}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="flex h-11 items-center divide-x divide-border rounded-md border border-border/60 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">
|
||||
Aucune loterie suivie pour {theme.name} pour le moment.
|
||||
</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 rounded-md border border-border/60 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">
|
||||
Aucune loterie suivie pour {theme.name} pour le moment.
|
||||
</div>
|
||||
)}
|
||||
|
||||
<p className="text-[11px] text-muted-foreground">
|
||||
Données fournies par LokiLab. Statistiques descriptives seulement — aucune garantie
|
||||
de gain.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user