's'
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 (
|
||||
<html lang="zh-CN" suppressHydrationWarning>
|
||||
<body
|
||||
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
||||
>
|
||||
<body className="antialiased">
|
||||
<ThemeScript />
|
||||
<ThemeProvider>{children}</ThemeProvider>
|
||||
</body>
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user