diff --git a/app/[locale]/meetups/host/page.tsx b/app/[locale]/meetups/host/page.tsx index ef9b4c9..e8767a2 100644 --- a/app/[locale]/meetups/host/page.tsx +++ b/app/[locale]/meetups/host/page.tsx @@ -4,7 +4,7 @@ import { useState } from "react"; import { Link, useLocale, useTranslation } from "@/i18n/navigation"; import { cities } from "@/app/data/cities"; -const CITY_OPTIONS = cities.map((c) => ({ value: c.name, label: `${c.emoji} ${c.name}` })); +const CITY_OPTIONS = cities.map((c) => ({ value: c.name, label: `${c.icon} ${c.name}` })); export default function HostMeetupPage() { const { t } = useTranslation("hostMeetup"); diff --git a/app/context/LocaleContext.tsx b/app/context/LocaleContext.tsx index 8adad73..8862962 100644 --- a/app/context/LocaleContext.tsx +++ b/app/context/LocaleContext.tsx @@ -85,15 +85,18 @@ export function useTranslation(namespace?: string) { }; } +function navigate(pathname: string, locale: Locale, opts?: { locale?: Locale }) { + const newLocale = opts?.locale ?? locale; + const cleanPath = pathname.replace(/^\/(zh|en)/, "") || "/"; + const newPath = `/${newLocale}${cleanPath === "/" ? "" : cleanPath}`; + window.location.href = newPath; +} + export function useLocaleRouter() { const locale = useLocale(); return { - replace: (pathname: string, opts?: { locale?: Locale }) => { - const newLocale = opts?.locale ?? locale; - const cleanPath = pathname.replace(/^\/(zh|en)/, "") || "/"; - const newPath = `/${newLocale}${cleanPath === "/" ? "" : cleanPath}`; - window.location.href = newPath; - }, + push: (pathname: string, opts?: { locale?: Locale }) => navigate(pathname, locale, opts), + replace: (pathname: string, opts?: { locale?: Locale }) => navigate(pathname, locale, opts), }; } diff --git a/app/globals.css b/app/globals.css index f75892d..13e5ded 100644 --- a/app/globals.css +++ b/app/globals.css @@ -5,6 +5,8 @@ :root { --background: #fafafa; --foreground: #111827; + --font-geist-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; + --font-geist-mono: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Monaco, "Courier New", "PingFang SC", monospace; } .dark { diff --git a/app/layout.tsx b/app/layout.tsx index d9d36dd..9ebf728 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,19 +1,8 @@ import type { Metadata, Viewport } from "next"; -import { Geist, Geist_Mono } from "next/font/google"; import "./globals.css"; import { ThemeProvider } from "./context/ThemeContext"; import { getSiteConfig } from "@/config"; -const geistSans = Geist({ - variable: "--font-geist-sans", - subsets: ["latin"], -}); - -const geistMono = Geist_Mono({ - variable: "--font-geist-mono", - subsets: ["latin"], -}); - export const viewport: Viewport = { width: "device-width", initialScale: 1, @@ -53,9 +42,7 @@ export default function RootLayout({ }>) { return ( - + {children} diff --git a/app/lib/charts/MembersMap.tsx b/app/lib/charts/MembersMap.tsx index 19270e0..6fc0db3 100644 --- a/app/lib/charts/MembersMap.tsx +++ b/app/lib/charts/MembersMap.tsx @@ -99,8 +99,9 @@ export function MembersMap({ chart.setOption(option); setReady(true); - chart.on("mouseover", (params: { data?: { id?: number } }) => { - const id = params.data?.id; + chart.on("mouseover", (params: unknown) => { + const p = params as { data?: { id?: number } }; + const id = p.data?.id; const city = id ? (data.find((c) => c.id === id) ?? null) : null; onCityHover?.(city); });