Country selector in the header, auto-detected and remembered

Replaces the left sidebar with a header dropdown (flag + name), like
1xbet's region picker. The shown country resolves as: saved choice
(cookie, then the member's profile so it follows them across devices),
else Cloudflare's CF-IPCountry (Canada maps to Québec), else Québec.
favoriteCountry becomes nullable so geo-detection isn't overridden by
a default nobody chose. Emoji flags render as letters on Windows, so
flags are now SVGs in /public/flags; country names are in French.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Nazim Kri
2026-10-30 09:58:33 -04:00
co-authored by Claude Opus 5.5
parent 2eafbfd3d7
commit e97b2e54ad
21 changed files with 200 additions and 162 deletions
+19
View File
@@ -1,8 +1,27 @@
"use server" "use server"
import { revalidatePath } from "next/cache" import { revalidatePath } from "next/cache"
import { cookies } from "next/headers"
import { prisma } from "@/lib/db"
import { getCurrentMember } from "@/lib/member-auth" import { getCurrentMember } from "@/lib/member-auth"
import { followPick, unfollowPick } from "@/lib/follows" import { followPick, unfollowPick } from "@/lib/follows"
import { COUNTRY_COOKIE, isKnownCountry } from "@/lib/country-pref"
export async function setCountryAction(code: string) {
if (!isKnownCountry(code)) return { ok: false as const }
const jar = await cookies()
jar.set(COUNTRY_COOKIE, code, {
httpOnly: true,
sameSite: "lax",
secure: process.env.NODE_ENV === "production",
maxAge: 365 * 24 * 3600,
path: "/",
})
const member = await getCurrentMember()
if (member) await prisma.user.update({ where: { id: member.id }, data: { favoriteCountry: code } })
revalidatePath("/", "layout")
return { ok: true as const }
}
export async function toggleFollowAction(lotteryId: string, country: string, targetDrawDate: string, isFollowing: boolean) { export async function toggleFollowAction(lotteryId: string, country: string, targetDrawDate: string, isFollowing: boolean) {
const member = await getCurrentMember() const member = await getCurrentMember()
+3 -2
View File
@@ -8,6 +8,7 @@ import { NumberFrequencyChart } from "@/components/number-frequency-chart"
import { PerformanceChart } from "@/components/performance-chart" 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"
export const instant = false export const instant = false
@@ -35,8 +36,8 @@ export default async function LotteryStatsPage({ params }: { params: Promise<{ i
<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>
<Badge variant="secondary"> <Badge variant="secondary" className="gap-1.5">
{theme.flagEmoji} {theme.name} <Flag code={theme.code} /> {theme.name}
</Badge> </Badge>
</div> </div>
<p className="mt-1 text-sm text-muted-foreground"> <p className="mt-1 text-sm text-muted-foreground">
+40 -63
View File
@@ -3,34 +3,29 @@ import { COUNTRIES, 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 { CountryNav, CountryNavMobile } from "@/components/country-nav" 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 { Hero } from "@/components/hero" import { Hero } from "@/components/hero"
import { Flag } from "@/components/flag"
import { Skeleton } from "@/components/ui/skeleton" import { Skeleton } from "@/components/ui/skeleton"
export const instant = false export const instant = false
export default async function Home({ export default function Home() {
searchParams,
}: {
searchParams: Promise<{ country?: string }>
}) {
const sp = await searchParams
const activeCode = sp.country && COUNTRIES.some((c) => c.code === sp.country) ? sp.country : "CA-QC"
return ( return (
<main className="flex flex-1 flex-col"> <main className="flex flex-1 flex-col">
<AppHeader /> <AppHeader />
<Suspense fallback={<HomeSkeleton />}> <Suspense fallback={<HomeSkeleton />}>
<HomeContent activeCode={activeCode} /> <HomeContent />
</Suspense> </Suspense>
</main> </main>
) )
} }
async function HomeContent({ activeCode }: { activeCode: string }) { async function HomeContent() {
const [feed, member] = await Promise.all([getArmyFeed(), getCurrentMember()]) const [feed, member] = await Promise.all([getArmyFeed(), getCurrentMember()])
const activeCode = await resolveCountry(member)
const theme = countryTheme(activeCode) const theme = countryTheme(activeCode)
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)
@@ -51,54 +46,41 @@ async function HomeContent({ activeCode }: { activeCode: string }) {
/> />
<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 px-4 py-4 sm:px-6" className="mx-auto w-full max-w-6xl flex-1 space-y-3 px-4 py-6 sm:px-6"
> >
<div className="sm:hidden mb-3"> <div className="flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1">
<CountryNavMobile active={activeCode} /> <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
</p>
</div> </div>
<div className="flex gap-5"> <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">
<aside className="hidden w-[200px] shrink-0 sm:block"> <Stat value={feed.army.total.toLocaleString("fr-CA")} label="Armée (global)" />
<CountryNav active={activeCode} /> <Stat value={countryMembers.toLocaleString("fr-CA")} label={`Membres — ${theme.name}`} />
</aside> <Stat value={totalTracked > 0 ? `${totalWins} / ${totalTracked}` : "—"} label="Grilles gagnantes" />
</div>
<div className="min-w-0 flex-1 space-y-3"> {lotteries.length > 0 ? (
<div className="flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1"> <LotteryResultsPanel
<h2 className="text-[22px] font-bold tracking-tight">{theme.name}</h2> lotteries={lotteries}
<p className="text-xs text-muted-foreground"> country={activeCode}
{lotteries.length} loterie{lotteries.length === 1 ? "" : "s"} suivie followedKeys={followedKeys}
{lotteries.length === 1 ? "" : "s"} isAuthenticated={!!member}
</p> />
</div> ) : (
<div className="rounded-md border border-dashed border-border py-16 text-center text-sm text-muted-foreground">
<div className="flex h-11 items-center divide-x divide-border rounded-md border border-border/60 bg-panel px-4 text-sm"> Les loteries de {theme.name} arrivent bientôt dans l&apos;univers de Loki.
<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> )}
<p className="text-[11px] text-muted-foreground">
Données fournies par LokiLab. Statistiques descriptives seulement — aucune garantie de gain.
</p>
</div> </div>
</> </>
) )
@@ -115,15 +97,10 @@ function Stat({ value, label }: { value: string; label: string }) {
function HomeSkeleton() { function HomeSkeleton() {
return ( return (
<div className="mx-auto w-full max-w-6xl px-4 py-4 sm:px-6"> <div className="mx-auto w-full max-w-6xl space-y-3 px-4 py-6 sm:px-6">
<div className="flex gap-5"> <Skeleton className="h-[520px] w-full" />
<Skeleton className="hidden h-96 w-[200px] shrink-0 sm:block" /> <Skeleton className="h-11 w-full" />
<div className="min-w-0 flex-1 space-y-3"> <Skeleton className="h-64 w-full" />
<Skeleton className="h-7 w-48" />
<Skeleton className="h-11 w-full" />
<Skeleton className="h-64 w-full" />
</div>
</div>
</div> </div>
) )
} }
+2 -1
View File
@@ -6,6 +6,7 @@ import { countryTheme } from "@/lib/countries"
import { AppHeader } from "@/components/app-header" import { AppHeader } from "@/components/app-header"
import { NicknameForm } from "@/components/nickname-form" import { NicknameForm } from "@/components/nickname-form"
import { Badge } from "@/components/ui/badge" import { Badge } from "@/components/ui/badge"
import { Flag } from "@/components/flag"
export const metadata: Metadata = { title: "Mon profil — LokiLoto" } export const metadata: Metadata = { title: "Mon profil — LokiLoto" }
export const instant = false export const instant = false
@@ -47,7 +48,7 @@ export default async function ProfilePage() {
return ( return (
<div key={f.id} className="flex items-center justify-between px-4 py-2.5 text-sm"> <div key={f.id} className="flex items-center justify-between px-4 py-2.5 text-sm">
<span className="flex items-center gap-2"> <span className="flex items-center gap-2">
<span aria-hidden>{theme.flagEmoji}</span> <Flag code={theme.code} />
{f.lotteryId} {f.lotteryId}
</span> </span>
<span className="text-xs text-muted-foreground">{f.targetDrawDate}</span> <span className="text-xs text-muted-foreground">{f.targetDrawDate}</span>
+12 -1
View File
@@ -2,7 +2,15 @@ import Image from "next/image"
import Link from "next/link" import Link from "next/link"
import { Suspense } from "react" import { Suspense } from "react"
import { UserMenu } from "@/components/user-menu" import { UserMenu } from "@/components/user-menu"
import { CountrySwitcher } from "@/components/country-switcher"
import { Skeleton } from "@/components/ui/skeleton" import { Skeleton } from "@/components/ui/skeleton"
import { getCurrentMember } from "@/lib/member-auth"
import { resolveCountry } from "@/lib/country-pref"
async function CountrySlot() {
const member = await getCurrentMember()
return <CountrySwitcher active={await resolveCountry(member)} />
}
export function AppHeader() { export function AppHeader() {
return ( return (
@@ -24,7 +32,10 @@ export function AppHeader() {
</Link> </Link>
</nav> </nav>
<div className="ml-auto"> <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" />}> <Suspense fallback={<Skeleton className="h-8 w-8 rounded-full" />}>
<UserMenu /> <UserMenu />
</Suspense> </Suspense>
-79
View File
@@ -1,79 +0,0 @@
"use client"
import Link from "next/link"
import { usePathname, useSearchParams } from "next/navigation"
import { COUNTRIES } from "@/lib/countries"
import { cn } from "@/lib/utils"
export function CountryNav({ active }: { active: string }) {
const pathname = usePathname()
const searchParams = useSearchParams()
function hrefFor(code: string) {
const params = new URLSearchParams(searchParams.toString())
params.set("country", code)
return `${pathname}?${params.toString()}`
}
return (
<nav aria-label="Sélection du pays" className="space-y-0.5">
{COUNTRIES.map((c) => {
const isActive = c.code === active
return (
<Link
key={c.code}
href={hrefFor(c.code)}
aria-current={isActive ? "page" : undefined}
className={cn(
"flex items-center gap-2.5 rounded-md border-l-[3px] py-2 pr-3 pl-2.5 text-[13px] font-medium transition-colors",
isActive
? "border-l-accent bg-panel-hover text-foreground"
: "border-l-transparent text-muted-foreground hover:bg-panel-hover/60 hover:text-foreground"
)}
>
<span aria-hidden className="w-5 shrink-0 text-center text-base leading-none">
{c.flagEmoji}
</span>
{c.name}
</Link>
)
})}
</nav>
)
}
export function CountryNavMobile({ active }: { active: string }) {
const pathname = usePathname()
const searchParams = useSearchParams()
function hrefFor(code: string) {
const params = new URLSearchParams(searchParams.toString())
params.set("country", code)
return `${pathname}?${params.toString()}`
}
return (
<nav
aria-label="Sélection du pays"
className="flex gap-1.5 overflow-x-auto pb-1 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
>
{COUNTRIES.map((c) => {
const isActive = c.code === active
return (
<Link
key={c.code}
href={hrefFor(c.code)}
aria-current={isActive ? "page" : undefined}
className={cn(
"flex shrink-0 items-center gap-1.5 rounded-full px-3 py-1.5 text-[13px] font-medium",
isActive ? "bg-accent-soft text-foreground" : "text-muted-foreground"
)}
>
<span aria-hidden>{c.flagEmoji}</span>
{c.name}
</Link>
)
})}
</nav>
)
}
+58
View File
@@ -0,0 +1,58 @@
"use client"
import { useTransition } from "react"
import { useRouter } from "next/navigation"
import { Check, ChevronDown } from "lucide-react"
import { COUNTRIES, countryTheme } from "@/lib/countries"
import { setCountryAction } from "@/app/actions"
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu"
import { cn } from "@/lib/utils"
import { Flag } from "@/components/flag"
export function CountrySwitcher({ active }: { active: string }) {
const router = useRouter()
const [pending, startTransition] = useTransition()
const current = countryTheme(active)
function choose(code: string) {
if (code === active) return
startTransition(async () => {
await setCountryAction(code)
router.refresh()
})
}
return (
<DropdownMenu>
<DropdownMenuTrigger
aria-label={`Pays : ${current.name}. Changer de pays`}
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",
pending && "opacity-60"
)}
>
<Flag code={current.code} />
<span className="hidden sm:inline">{current.name}</span>
<ChevronDown className="h-3.5 w-3.5 text-muted-foreground" />
</DropdownMenuTrigger>
<DropdownMenuContent align="end" className="w-56">
<DropdownMenuLabel className="text-xs text-muted-foreground">Choisir un pays</DropdownMenuLabel>
<DropdownMenuSeparator />
{COUNTRIES.map((c) => (
<DropdownMenuItem key={c.code} onSelect={() => choose(c.code)} className="gap-2.5">
<Flag code={c.code} />
<span className="flex-1">{c.name}</span>
{c.code === active && <Check className="h-4 w-4 text-gold" />}
</DropdownMenuItem>
))}
</DropdownMenuContent>
</DropdownMenu>
)
}
+14
View File
@@ -0,0 +1,14 @@
import { cn } from "@/lib/utils"
/** SVG flag from /public/flags — emoji flags don't render on Windows. */
export function Flag({ code, className }: { code: string; className?: string }) {
return (
// eslint-disable-next-line @next/next/no-img-element
<img
src={`/flags/${code.toLowerCase()}.svg`}
alt=""
aria-hidden="true"
className={cn("inline-block h-[14px] w-[21px] shrink-0 rounded-[2px] object-cover ring-1 ring-black/20", className)}
/>
)
}
+3 -13
View File
@@ -10,7 +10,6 @@
export interface CountryTheme { export interface CountryTheme {
code: string // ISO 3166-1 alpha-2, or a region code like 'CA-QC' code: string // ISO 3166-1 alpha-2, or a region code like 'CA-QC'
name: string name: string
flagEmoji: string
flagPrimary: string flagPrimary: string
flagSecondary: string flagSecondary: string
accent: string // oklch(), CSS custom property value accent: string // oklch(), CSS custom property value
@@ -23,7 +22,6 @@ export const COUNTRIES: CountryTheme[] = [
{ {
code: 'CA-QC', code: 'CA-QC',
name: 'Québec', name: 'Québec',
flagEmoji: '⚜️',
flagPrimary: '#1768C4', flagPrimary: '#1768C4',
flagSecondary: '#183653', flagSecondary: '#183653',
accent: 'oklch(0.62 0.16 255.5)', accent: 'oklch(0.62 0.16 255.5)',
@@ -32,7 +30,6 @@ export const COUNTRIES: CountryTheme[] = [
{ {
code: 'FR', code: 'FR',
name: 'France', name: 'France',
flagEmoji: '🇫🇷',
flagPrimary: '#0055A4', flagPrimary: '#0055A4',
flagSecondary: '#EF4135', flagSecondary: '#EF4135',
accent: 'oklch(0.63 0.19 28.6)', accent: 'oklch(0.63 0.19 28.6)',
@@ -40,8 +37,7 @@ export const COUNTRIES: CountryTheme[] = [
}, },
{ {
code: 'US', code: 'US',
name: 'United States', name: 'États-Unis',
flagEmoji: '🇺🇸',
flagPrimary: '#B22234', flagPrimary: '#B22234',
flagSecondary: '#3C3B6E', flagSecondary: '#3C3B6E',
accent: 'oklch(0.6 0.17 20.7)', accent: 'oklch(0.6 0.17 20.7)',
@@ -49,8 +45,7 @@ export const COUNTRIES: CountryTheme[] = [
}, },
{ {
code: 'ES', code: 'ES',
name: 'España', name: 'Espagne',
flagEmoji: '🇪🇸',
flagPrimary: '#AA151B', flagPrimary: '#AA151B',
flagSecondary: '#F1BF00', flagSecondary: '#F1BF00',
accent: 'oklch(0.76 0.16 89.6)', accent: 'oklch(0.76 0.16 89.6)',
@@ -58,8 +53,7 @@ export const COUNTRIES: CountryTheme[] = [
}, },
{ {
code: 'IT', code: 'IT',
name: 'Italia', name: 'Italie',
flagEmoji: '🇮🇹',
flagPrimary: '#009246', flagPrimary: '#009246',
flagSecondary: '#CE2B37', flagSecondary: '#CE2B37',
accent: 'oklch(0.65 0.15 151.1)', accent: 'oklch(0.65 0.15 151.1)',
@@ -68,7 +62,6 @@ export const COUNTRIES: CountryTheme[] = [
{ {
code: 'PT', code: 'PT',
name: 'Portugal', name: 'Portugal',
flagEmoji: '🇵🇹',
flagPrimary: '#046A38', flagPrimary: '#046A38',
flagSecondary: '#DA020E', flagSecondary: '#DA020E',
accent: 'oklch(0.63 0.14 153.6)', accent: 'oklch(0.63 0.14 153.6)',
@@ -77,7 +70,6 @@ export const COUNTRIES: CountryTheme[] = [
{ {
code: 'DZ', code: 'DZ',
name: 'Algérie', name: 'Algérie',
flagEmoji: '🇩🇿',
flagPrimary: '#006233', flagPrimary: '#006233',
flagSecondary: '#D21034', flagSecondary: '#D21034',
accent: 'oklch(0.6 0.13 153.7)', accent: 'oklch(0.6 0.13 153.7)',
@@ -86,7 +78,6 @@ export const COUNTRIES: CountryTheme[] = [
{ {
code: 'MA', code: 'MA',
name: 'Maroc', name: 'Maroc',
flagEmoji: '🇲🇦',
flagPrimary: '#C1272D', flagPrimary: '#C1272D',
flagSecondary: '#006233', flagSecondary: '#006233',
accent: 'oklch(0.58 0.19 25)', accent: 'oklch(0.58 0.19 25)',
@@ -99,7 +90,6 @@ export function countryTheme(code: string): CountryTheme {
COUNTRIES.find((c) => c.code === code) ?? { COUNTRIES.find((c) => c.code === code) ?? {
code, code,
name: code, name: code,
flagEmoji: '🏳️',
flagPrimary: '#D7AE54', flagPrimary: '#D7AE54',
flagSecondary: '#242B36', flagSecondary: '#242B36',
accent: FALLBACK_ACCENT, accent: FALLBACK_ACCENT,
+32
View File
@@ -0,0 +1,32 @@
import 'server-only'
import { cookies, headers } from 'next/headers'
import { COUNTRIES } from './countries'
import type { CurrentMember } from './member-auth'
export const COUNTRY_COOKIE = 'lokiloto_country'
export const DEFAULT_COUNTRY = 'CA-QC'
function isKnown(code: string | null | undefined): code is string {
return !!code && COUNTRIES.some((c) => c.code === code)
}
/** Cloudflare's CF-IPCountry is ISO alpha-2; Canada maps to Québec, the only Canadian locale so far. */
function fromGeo(iso: string | null): string | null {
if (!iso) return null
const code = iso.toUpperCase() === 'CA' ? 'CA-QC' : iso.toUpperCase()
return isKnown(code) ? code : null
}
/** Saved choice (cookie, then member profile) beats geo-detection, which beats the default. */
export async function resolveCountry(member: CurrentMember | null): Promise<string> {
const jar = await cookies()
const saved = jar.get(COUNTRY_COOKIE)?.value
if (isKnown(saved)) return saved
if (isKnown(member?.favoriteCountry)) return member.favoriteCountry
const h = await headers()
return fromGeo(h.get('cf-ipcountry')) ?? DEFAULT_COUNTRY
}
export function isKnownCountry(code: string): boolean {
return isKnown(code)
}
+1 -1
View File
@@ -26,7 +26,7 @@ export interface CurrentMember {
name: string name: string
avatarUrl: string | null avatarUrl: string | null
publicNickname: string | null publicNickname: string | null
favoriteCountry: string favoriteCountry: string | null
} }
export async function getCurrentMember(): Promise<CurrentMember | null> { export async function getCurrentMember(): Promise<CurrentMember | null> {
@@ -0,0 +1,5 @@
-- A member's country preference is only set when they actually pick one,
-- so geo-detection isn't overridden by a default nobody chose.
ALTER TABLE "User" ALTER COLUMN "favoriteCountry" DROP NOT NULL;
ALTER TABLE "User" ALTER COLUMN "favoriteCountry" DROP DEFAULT;
UPDATE "User" SET "favoriteCountry" = NULL WHERE "favoriteCountry" = 'CA-QC';
+3 -2
View File
@@ -23,8 +23,9 @@ model User {
/// (leaderboard, follow counts). Must be set before a member appears /// (leaderboard, follow counts). Must be set before a member appears
/// publicly. /// publicly.
publicNickname String? publicNickname String?
/// Last country tab the member viewed, restored on next visit. /// Country the member explicitly picked in the header selector — synced
favoriteCountry String @default("CA-QC") /// across devices. Null until they pick one, so geo-detection applies.
favoriteCountry String?
createdAt DateTime @default(now()) createdAt DateTime @default(now())
updatedAt DateTime @updatedAt updatedAt DateTime @updatedAt
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 20"><rect width="30" height="20" fill="#003DA5"/><rect x="13" width="4" height="20" fill="#fff"/><rect y="8" width="30" height="4" fill="#fff"/><g id="f" fill="#fff"><path d="M6.5 2.2c.6.7.9 1.5.9 2.3 0 .8-.4 1.4-.9 1.9-.5-.5-.9-1.1-.9-1.9 0-.8.3-1.6.9-2.3z"/><path d="M4.6 4.4c.9 0 1.5.8 1.5 1.7v.4H4.9c-.6 0-1-.4-1-1 0-.6.3-1.1.7-1.1zM8.4 4.4c-.9 0-1.5.8-1.5 1.7v.4h1.2c.6 0 1-.4 1-1 0-.6-.3-1.1-.7-1.1z"/><rect x="4.4" y="6.4" width="4.2" height=".7" rx=".3"/></g><use href="#f" x="17"/><use href="#f" y="11.4"/><use href="#f" x="17" y="11.4"/></svg>

After

Width:  |  Height:  |  Size: 610 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 513 342"><path fill="#41662E" d="M0 0h513v342H0z"/><path fill="#FFF" d="M256.5 0H513v342H256.5z"/><g fill="#D80027"><path d="m341.5 105.3-29.4 40.4-47.5-15.4 29.4 40.4-29.4 40.4 47.5-15.4 29.4 40.4v-50l47.5-15.5-47.5-15.4z"/><path d="M309.9 276.7c-58.5 0-106-47.5-106-106s47.5-106 106-106c18.3 0 35.4 4.6 50.4 12.7-23.5-23-55.7-37.2-91.2-37.2-72 0-130.4 58.4-130.4 130.4S197.1 301 269.1 301c35.5 0 67.7-14.2 91.2-37.2-14.9 8.2-32.1 12.9-50.4 12.9z"/></g></svg>

After

Width:  |  Height:  |  Size: 513 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22.5 15"><path fill="#FFF" d="M0 0h22.5v15H0V0z"/><path fill="#D03433" d="M0 0h22.5v4H0V0zm0 11h22.5v4H0v-4z"/><path fill="#FBCA46" d="M0 4h22.5v7H0V4z"/><path fill="#FFF" d="M7.8 7h1v.5h-1V7z"/><path fill="#A41517" d="M7.2 8.5c0 .3.3.5.6.5s.6-.2.6-.5L8.5 7H7.1l.1 1.5zM6.6 7c0-.3.2-.5.4-.5h1.5c.3 0 .5.2.5.4V7l-.1 1.5c-.1.6-.5 1-1.1 1-.6 0-1-.4-1.1-1L6.6 7z"/><path fill="#A41517" d="M6.8 7.5h2V8h-.5l-.5 1-.5-1h-.5v-.5zM5.3 6h1v3.5h-1V6zm4 0h1v3.5h-1V6zm-2.5-.5c0-.3.2-.5.5-.5h1c.3 0 .5.2.5.5v.2c0 .2-.1.3-.3.3H7c-.1 0-.2-.1-.2-.2v-.3z"/></svg>

After

Width:  |  Height:  |  Size: 599 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 513 342"><path fill="#FFF" d="M0 0h513v342H0z"/><path fill="#00318A" d="M0 0h171v342H0z"/><path fill="#D80027" d="M342 0h171v342H342z"/></svg>

After

Width:  |  Height:  |  Size: 195 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 513 342"><path fill="#F4F5F0" d="M342 0H0v341.3h512V0z"/><path fill="#008C45" d="M0 0h171v342H0z"/><path fill="#CD212A" d="M342 0h171v342H342z"/></svg>

After

Width:  |  Height:  |  Size: 204 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 513 342"><path fill="#d12a46" d="M0 .3V342h513V.3z"/><path fill="#316525" d="M359.8 148.9h-73.3l-22.7-69.7-22.7 69.7h-73.3l59.3 43.1-22.7 69.7 59.3-43.1 59.3 43.1-22.5-69.7 59.3-43.1zm-116.1 37.7 7.7-23.6h24.8l7.7 23.6-20.1 14.6-20.1-14.6zm27.9-37.7H256l7.8-24 7.8 24zm24.3 29-4.8-14.9h25.3l-20.5 14.9zM236.6 163l-4.8 14.9-20.5-14.9h25.3zm-5.3 61.8 7.8-24 12.6 9.2-20.4 14.8zm44.5-14.9 12.6-9.2 7.8 24-20.4-14.8z"/></svg>

After

Width:  |  Height:  |  Size: 474 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 513 342"><path fill="red" d="M0 0h513v342H0z"/><path fill="#060" d="M197 0v342H0V0z"/><circle fill="#FF0" cx="197.1" cy="171" r="64"/><path fill="red" d="M161.1 139v40c0 19.9 16.1 36 36 36s36-16.1 36-36v-40h-72z"/><path fill="#FFF" d="M197.1 191c-6.6 0-12-5.4-12-12v-16h24v16c0 6.6-5.3 12-12 12z"/></svg>

After

Width:  |  Height:  |  Size: 357 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 513 342"><path fill="#FFF" d="M0 0h513v342H0z"/><g fill="#D80027"><path d="M0 0h513v26.3H0zM0 52.6h513v26.3H0zM0 105.2h513v26.3H0zM0 157.8h513v26.3H0zM0 210.5h513v26.3H0zM0 263.1h513v26.3H0zM0 315.7h513V342H0z"/></g><path fill="#2E52B2" d="M0 0h256.5v184.1H0z"/><g fill="#FFF"><path d="m47.8 138.9-4-12.8-4.4 12.8H26.2l10.7 7.7-4 12.8 10.9-7.9 10.6 7.9-4.1-12.8 10.9-7.7zM104.1 138.9l-4.1-12.8-4.2 12.8H82.6l10.7 7.7-4 12.8 10.7-7.9 10.8 7.9-4-12.8 10.7-7.7zM160.6 138.9l-4.3-12.8-4 12.8h-13.5l11 7.7-4.2 12.8 10.7-7.9 11 7.9-4.2-12.8 10.7-7.7zM216.8 138.9l-4-12.8-4.2 12.8h-13.3l10.8 7.7-4 12.8 10.7-7.9 10.8 7.9-4.3-12.8 11-7.7zM100 75.3l-4.2 12.8H82.6L93.3 96l-4 12.6 10.7-7.8 10.8 7.8-4-12.6 10.7-7.9h-13.4zM43.8 75.3l-4.4 12.8H26.2L36.9 96l-4 12.6 10.9-7.8 10.6 7.8L50.3 96l10.9-7.9H47.8zM156.3 75.3l-4 12.8h-13.5l11 7.9-4.2 12.6 10.7-7.8 11 7.8-4.2-12.6 10.7-7.9h-13.2zM212.8 75.3l-4.2 12.8h-13.3l10.8 7.9-4 12.6 10.7-7.8 10.8 7.8-4.3-12.6 11-7.9h-13.5zM43.8 24.7l-4.4 12.6H26.2l10.7 7.9-4 12.7L43.8 50l10.6 7.9-4.1-12.7 10.9-7.9H47.8zM100 24.7l-4.2 12.6H82.6l10.7 7.9-4 12.7L100 50l10.8 7.9-4-12.7 10.7-7.9h-13.4zM156.3 24.7l-4 12.6h-13.5l11 7.9-4.2 12.7 10.7-7.9 11 7.9-4.2-12.7 10.7-7.9h-13.2zM212.8 24.7l-4.2 12.6h-13.3l10.8 7.9-4 12.7 10.7-7.9 10.8 7.9-4.3-12.7 11-7.9h-13.5z"/></g></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB