diff --git a/app/connexion/page.tsx b/app/connexion/page.tsx index 826108e..fbb63a6 100644 --- a/app/connexion/page.tsx +++ b/app/connexion/page.tsx @@ -43,7 +43,7 @@ export default async function LoginPage({ {error &&

{error}

}
- +
diff --git a/app/loterie/[id]/page.tsx b/app/loterie/[id]/page.tsx index 31887a0..19f3f5e 100644 --- a/app/loterie/[id]/page.tsx +++ b/app/loterie/[id]/page.tsx @@ -9,6 +9,7 @@ import { PerformanceChart } from "@/components/performance-chart" import { DrawTimeline } from "@/components/draw-timeline" import { Badge } from "@/components/ui/badge" import { Flag } from "@/components/flag" +import { LotteryStrip } from "@/components/lottery-strip" 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} > + l.country === entry.country)} activeId={entry.id} />

{entry.name}

diff --git a/app/page.tsx b/app/page.tsx index f699e46..59669e4 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -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 ( <> - +
-
-

- - {theme.name} -

-

- {lotteries.length} loterie{lotteries.length === 1 ? "" : "s"} suivie - {lotteries.length === 1 ? "" : "s"} · changez de pays en haut à droite +

+ + +
+
+ +

Derniers tirages — {theme.name}

+ + {totalTracked > 0 ? `Loki : ${totalWins}/${totalTracked} grilles gagnantes` : `${lotteries.length} loteries`} + +
+ {lotteries.length > 0 ? ( + + ) : ( +

+ Les loteries de {theme.name} arrivent bientôt dans l'univers de Loki. +

+ )} +
+ +

+ Données fournies par LokiLab. Statistiques descriptives seulement — aucune garantie de gain.

-
- - - 0 ? `${totalWins} / ${totalTracked}` : "—"} label="Grilles gagnantes" /> -
- - {lotteries.length > 0 ? ( - - ) : ( -
- Les loteries de {theme.name} arrivent bientôt dans l'univers de Loki. -
- )} - -

- Données fournies par LokiLab. Statistiques descriptives seulement — aucune garantie de gain. -

+ }> + +
) } -function Stat({ value, label }: { value: string; label: string }) { - return ( -
- {value} - {label} -
- ) -} - function HomeSkeleton() { return ( -
- - - +
+
+ + +
+
) } diff --git a/components/app-header.tsx b/components/app-header.tsx index f79938b..43f181e 100644 --- a/components/app-header.tsx +++ b/components/app-header.tsx @@ -9,13 +9,31 @@ import { resolveCountry } from "@/lib/country-pref" async function CountrySlot() { const member = await getCurrentMember() - return + return } +/** Two stacked bars, 1xbet-style: a thin utility bar (country, auth), then the main bar (logo, nav). */ export function AppHeader() { return ( -
-
+
+
+
+

+ Pronostics & statistiques de loterie — l'univers de Loki +

+
+ }> + + + + }> + + +
+
+
+ +
@@ -23,7 +41,7 @@ export function AppHeader() { -
-
+ ) } diff --git a/components/country-switcher.tsx b/components/country-switcher.tsx index b022fed..9eeed90 100644 --- a/components/country-switcher.tsx +++ b/components/country-switcher.tsx @@ -16,7 +16,7 @@ import { import { cn } from "@/lib/utils" import { Flag } from "@/components/flag" -export function CountrySwitcher({ active }: { active: string }) { +export function CountrySwitcher({ active, compact }: { active: string; compact?: boolean }) { const router = useRouter() const [pending, startTransition] = useTransition() const current = countryTheme(active) @@ -34,7 +34,10 @@ export function CountrySwitcher({ active }: { active: string }) { diff --git a/components/hero.tsx b/components/hero.tsx index 4f59267..518bdbb 100644 --- a/components/hero.tsx +++ b/components/hero.tsx @@ -1,92 +1,44 @@ import Image from "next/image" import Link from "next/link" -import { Users, Trophy, Globe } from "lucide-react" import { Button } from "@/components/ui/button" -export function Hero({ - armyTotal, - countryCount, - totalWins, - isAuthenticated, -}: { - armyTotal: number - countryCount: number - totalWins: number - isAuthenticated: boolean -}) { +/** Compact promo banner, 1xbet-style: short, wide, one message and one CTA — data stays above the fold. */ +export function Hero({ isAuthenticated }: { isAuthenticated: boolean }) { return ( -
- - - + +
+ +
+
+

L'armée de Loki

+

+ Loki lit les tirages. Suivez ses choix. +

+

+ Suivez ses pronostics, grimpez au classement — gratuit. +

+ +
+ - -
-
- -
-
-

L'armée de Loki

-

- Loki lit les tirages. -
- Vous décidez de le suivre. -

-

- Résultats, statistiques et pronostics de loterie, pays par pays. Rejoignez l'armée, - suivez les choix de Loki et grimpez au classement. -

- -
- {!isAuthenticated && ( - - )} - -
- -
- - - -
-
- -
-
- Loki, la mascotte de LokiLoto, salue de la main -
) } - -function HeroStat({ icon: Icon, value, label }: { icon: typeof Users; value: string; label: string }) { - return ( -
- -

{value}

-

{label}

-
- ) -} diff --git a/components/lottery-results-panel.tsx b/components/lottery-results-panel.tsx index 08413ae..5883a31 100644 --- a/components/lottery-results-panel.tsx +++ b/components/lottery-results-panel.tsx @@ -14,8 +14,8 @@ export function LotteryResultsPanel({ isAuthenticated: boolean }) { return ( -
-
+
+
Loterie Résultat officiel diff --git a/components/lottery-strip.tsx b/components/lottery-strip.tsx new file mode 100644 index 0000000..c7ef764 --- /dev/null +++ b/components/lottery-strip.tsx @@ -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 = { + "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 ( +
+
+ + {lotteries.map((l) => ( + + ))} +
+
+ ) +} + +function StripItem({ + href, + icon: Icon, + label, + active, +}: { + href: string + icon: LucideIcon + label: string + active?: boolean +}) { + return ( + + + {label} + + ) +} + +function shortName(name: string) { + return name.replace(" (Daily Grand)", "").replace("Quotidienne ", "Quot. ") +} diff --git a/components/member-auth-form.tsx b/components/member-auth-form.tsx index 956cffa..4c83fe7 100644 --- a/components/member-auth-form.tsx +++ b/components/member-auth-form.tsx @@ -9,8 +9,8 @@ import { cn } from "@/lib/utils" const INITIAL: MemberAuthState = { ok: false, message: "" } -export function MemberAuthForm({ next }: { next: string }) { - const [mode, setMode] = useState<"login" | "signup">("login") +export function MemberAuthForm({ next, initialMode = "login" }: { next: string; initialMode?: "login" | "signup" }) { + const [mode, setMode] = useState<"login" | "signup">(initialMode) const [loginState, loginAction, loginPending] = useActionState(loginWithPassword, INITIAL) const [signupState, signupActionFn, signupPending] = useActionState(signupWithPassword, INITIAL) diff --git a/components/side-rail.tsx b/components/side-rail.tsx new file mode 100644 index 0000000..33f3f25 --- /dev/null +++ b/components/side-rail.tsx @@ -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 ( + + ) +} + +function RailStat({ icon: Icon, value, label }: { icon: typeof Users; value: string; label: string }) { + return ( +
+ +

{value}

+

{label}

+
+ ) +} diff --git a/components/user-menu.tsx b/components/user-menu.tsx index b9a518b..8e2bfb3 100644 --- a/components/user-menu.tsx +++ b/components/user-menu.tsx @@ -15,9 +15,14 @@ export async function UserMenu() { if (!member) { return ( - +
+ + +
) } @@ -26,8 +31,9 @@ export async function UserMenu() { return ( - - + + {displayName} + {initial}