'x'
This commit is contained in:
153
app/[locale]/feedback/page.tsx
Normal file
153
app/[locale]/feedback/page.tsx
Normal file
@@ -0,0 +1,153 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import { useTranslation } from "@/i18n/navigation";
|
||||
import Footer from "@/app/components/Footer";
|
||||
|
||||
export default function FeedbackPage() {
|
||||
const { t } = useTranslation("feedback");
|
||||
const [submitted, setSubmitted] = useState(false);
|
||||
const [form, setForm] = useState({
|
||||
type: "suggestion" as "suggestion" | "bug",
|
||||
email: "",
|
||||
title: "",
|
||||
content: "",
|
||||
});
|
||||
|
||||
const handleSubmit = (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
setSubmitted(true);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-[#fafafa] dark:bg-gray-950">
|
||||
<main className="max-w-[640px] mx-auto px-4 sm:px-6 py-8 sm:py-12">
|
||||
<header className="mb-8">
|
||||
<h1 className="text-2xl sm:text-3xl font-bold text-gray-900 dark:text-gray-100 flex items-center gap-2">
|
||||
<span className="w-1 h-8 bg-[#ff4d4f] rounded-full" />
|
||||
{t("title")}
|
||||
</h1>
|
||||
<p className="text-gray-500 dark:text-gray-400 mt-1 text-sm sm:text-base">
|
||||
{t("subtitle")}
|
||||
</p>
|
||||
</header>
|
||||
|
||||
{submitted ? (
|
||||
<div className="bg-white dark:bg-gray-900 rounded-2xl shadow-sm border border-gray-100 dark:border-gray-800 p-8 text-center">
|
||||
<span className="text-5xl mb-4 block">🙏</span>
|
||||
<h2 className="text-xl font-bold text-gray-900 dark:text-gray-100 mb-2">
|
||||
{t("successTitle")}
|
||||
</h2>
|
||||
<p className="text-gray-500 dark:text-gray-400 mb-6">
|
||||
{t("successDesc")}
|
||||
</p>
|
||||
<button
|
||||
onClick={() => {
|
||||
setSubmitted(false);
|
||||
setForm({ type: "suggestion", email: "", title: "", content: "" });
|
||||
}}
|
||||
className="px-6 py-2.5 rounded-xl border border-gray-200 dark:border-gray-700 text-gray-700 dark:text-gray-300 font-medium hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors"
|
||||
>
|
||||
{t("submitAnother")}
|
||||
</button>
|
||||
</div>
|
||||
) : (
|
||||
<form
|
||||
onSubmit={handleSubmit}
|
||||
className="bg-white dark:bg-gray-900 rounded-2xl shadow-sm border border-gray-100 dark:border-gray-800 p-6 sm:p-8 space-y-6"
|
||||
>
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
||||
{t("type")} *
|
||||
</label>
|
||||
<div className="flex gap-3">
|
||||
<label className="flex-1 flex items-center justify-center gap-2 p-3 rounded-xl border cursor-pointer transition-colors has-[:checked]:border-[#ff4d4f] has-[:checked]:bg-[#ff4d4f]/5">
|
||||
<input
|
||||
type="radio"
|
||||
name="type"
|
||||
value="suggestion"
|
||||
checked={form.type === "suggestion"}
|
||||
onChange={(e) =>
|
||||
setForm((f) => ({ ...f, type: e.target.value as "suggestion" }))
|
||||
}
|
||||
className="sr-only"
|
||||
/>
|
||||
<span>💡</span>
|
||||
<span>{t("suggestion")}</span>
|
||||
</label>
|
||||
<label className="flex-1 flex items-center justify-center gap-2 p-3 rounded-xl border cursor-pointer transition-colors has-[:checked]:border-[#ff4d4f] has-[:checked]:bg-[#ff4d4f]/5">
|
||||
<input
|
||||
type="radio"
|
||||
name="type"
|
||||
value="bug"
|
||||
checked={form.type === "bug"}
|
||||
onChange={(e) =>
|
||||
setForm((f) => ({ ...f, type: e.target.value as "bug" }))
|
||||
}
|
||||
className="sr-only"
|
||||
/>
|
||||
<span>🐛</span>
|
||||
<span>{t("bug")}</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
||||
{t("email")} *
|
||||
</label>
|
||||
<input
|
||||
type="email"
|
||||
required
|
||||
value={form.email}
|
||||
onChange={(e) => setForm((f) => ({ ...f, email: e.target.value }))}
|
||||
placeholder={t("emailPlaceholder")}
|
||||
className="w-full px-4 py-3 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-[#ff4d4f]/20 focus:border-[#ff4d4f]"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
||||
{t("titleLabel")} *
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
required
|
||||
value={form.title}
|
||||
onChange={(e) => setForm((f) => ({ ...f, title: e.target.value }))}
|
||||
placeholder={t("titlePlaceholder")}
|
||||
className="w-full px-4 py-3 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-[#ff4d4f]/20 focus:border-[#ff4d4f]"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
||||
{t("content")} *
|
||||
</label>
|
||||
<textarea
|
||||
required
|
||||
rows={5}
|
||||
value={form.content}
|
||||
onChange={(e) => setForm((f) => ({ ...f, content: e.target.value }))}
|
||||
placeholder={t("contentPlaceholder")}
|
||||
className="w-full px-4 py-3 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-[#ff4d4f]/20 focus:border-[#ff4d4f] resize-none"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<p className="text-xs text-gray-400 dark:text-gray-500">
|
||||
{t("demoHint")}
|
||||
</p>
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
className="w-full py-3.5 rounded-xl bg-[#ff4d4f] text-white font-semibold hover:bg-[#ff7a45] transition-colors"
|
||||
>
|
||||
{t("submit")}
|
||||
</button>
|
||||
</form>
|
||||
)}
|
||||
</main>
|
||||
<Footer />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import { LocaleProvider } from "../context/LocaleContext";
|
||||
import type { Locale } from "../context/LocaleContext";
|
||||
import { getThemeMessages } from "@/app/lib/theme-data";
|
||||
import Navbar from "../components/Navbar";
|
||||
import SetLangAttr from "../components/SetLangAttr";
|
||||
|
||||
const LOCALES: Locale[] = ["zh", "en"];
|
||||
|
||||
@@ -33,6 +34,7 @@ export default async function LocaleLayout({
|
||||
|
||||
return (
|
||||
<LocaleProvider locale={locale as Locale} messages={messages}>
|
||||
<SetLangAttr />
|
||||
<Navbar />
|
||||
{children}
|
||||
</LocaleProvider>
|
||||
|
||||
109
app/[locale]/map/page.tsx
Normal file
109
app/[locale]/map/page.tsx
Normal file
@@ -0,0 +1,109 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useMemo } from "react";
|
||||
import { useLocale, useTranslation } from "@/i18n/navigation";
|
||||
import { useTheme } from "@/app/context/ThemeContext";
|
||||
import { MembersMap } from "@/app/lib/charts";
|
||||
import { MAP_CITIES } from "@/app/data/map-cities";
|
||||
|
||||
export default function MembersMapPage() {
|
||||
const { t } = useTranslation("membersMap");
|
||||
const locale = useLocale();
|
||||
const { theme } = useTheme();
|
||||
const [hoveredCity, setHoveredCity] = useState<typeof MAP_CITIES[0] | null>(null);
|
||||
|
||||
const totalMembers = useMemo(
|
||||
() => MAP_CITIES.reduce((sum, c) => sum + c.nomadsNow, 0),
|
||||
[]
|
||||
);
|
||||
|
||||
const sortedCities = useMemo(
|
||||
() => [...MAP_CITIES].sort((a, b) => b.nomadsNow - a.nomadsNow),
|
||||
[]
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-[#fafafa] dark:bg-gray-950">
|
||||
<main className="max-w-[1200px] mx-auto px-4 sm:px-6 py-8 sm:py-12">
|
||||
<header className="mb-8">
|
||||
<h1 className="text-2xl sm:text-3xl font-bold text-gray-900 dark:text-gray-100 flex items-center gap-2">
|
||||
<span className="w-1 h-8 bg-[#ff4d4f] rounded-full" />
|
||||
{t("title")}
|
||||
</h1>
|
||||
<p className="text-gray-500 dark:text-gray-400 mt-1 text-sm sm:text-base">
|
||||
{t("subtitle")}
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6 lg:gap-8">
|
||||
<div className="lg:col-span-2 bg-white dark:bg-gray-900 rounded-2xl shadow-sm border border-gray-100 dark:border-gray-800 overflow-hidden p-4 sm:p-6">
|
||||
<div className="rounded-xl overflow-hidden bg-gray-50 dark:bg-gray-800/50">
|
||||
<MembersMap
|
||||
data={MAP_CITIES}
|
||||
locale={locale}
|
||||
dark={theme === "dark"}
|
||||
className="min-h-[400px]"
|
||||
onCityHover={setHoveredCity}
|
||||
/>
|
||||
</div>
|
||||
{hoveredCity && (
|
||||
<div className="mt-4 p-3 bg-gray-50 dark:bg-gray-800 rounded-lg">
|
||||
<p className="text-sm font-medium text-gray-900 dark:text-gray-100">
|
||||
{locale === "zh" ? hoveredCity.name : hoveredCity.nameEn} {hoveredCity.emoji}
|
||||
</p>
|
||||
<p className="text-xs text-gray-500 dark:text-gray-400 mt-0.5">
|
||||
{hoveredCity.nomadsNow} {t("nomadsInCity")}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="space-y-6">
|
||||
<div className="bg-white dark:bg-gray-900 rounded-2xl shadow-sm border border-gray-100 dark:border-gray-800 p-6">
|
||||
<h3 className="text-sm font-bold text-gray-400 dark:text-gray-500 uppercase tracking-wider mb-2">
|
||||
{t("totalMembers")}
|
||||
</h3>
|
||||
<p className="text-3xl font-bold text-gray-900 dark:text-gray-100">
|
||||
{totalMembers.toLocaleString()}+
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="bg-white dark:bg-gray-900 rounded-2xl shadow-sm border border-gray-100 dark:border-gray-800 p-6">
|
||||
<h3 className="text-sm font-bold text-gray-400 dark:text-gray-500 uppercase tracking-wider mb-4">
|
||||
{t("cities")}
|
||||
</h3>
|
||||
<ul className="space-y-2 max-h-[280px] overflow-y-auto">
|
||||
{sortedCities.map((city) => (
|
||||
<li
|
||||
key={city.id}
|
||||
className={`flex items-center justify-between py-2 px-3 rounded-lg cursor-pointer transition-colors ${
|
||||
hoveredCity?.id === city.id
|
||||
? "bg-[#ff4d4f]/10 text-[#ff4d4f]"
|
||||
: "hover:bg-gray-50 dark:hover:bg-gray-800"
|
||||
}`}
|
||||
onMouseEnter={() => setHoveredCity(city)}
|
||||
onMouseLeave={() => setHoveredCity(null)}
|
||||
>
|
||||
<span className="flex items-center gap-2">
|
||||
<span>{city.emoji}</span>
|
||||
<span className="font-medium text-gray-900 dark:text-gray-100">
|
||||
{locale === "zh" ? city.name : city.nameEn}
|
||||
</span>
|
||||
</span>
|
||||
<span className="text-sm text-gray-500 dark:text-gray-400">
|
||||
{city.nomadsNow}
|
||||
</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p className="text-xs text-gray-400 dark:text-gray-500 mt-6 text-center">
|
||||
{t("demoHint")}
|
||||
</p>
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
199
app/[locale]/meetups/host/page.tsx
Normal file
199
app/[locale]/meetups/host/page.tsx
Normal file
@@ -0,0 +1,199 @@
|
||||
"use client";
|
||||
|
||||
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}` }));
|
||||
|
||||
export default function HostMeetupPage() {
|
||||
const { t } = useTranslation("hostMeetup");
|
||||
const locale = useLocale();
|
||||
const [submitted, setSubmitted] = useState(false);
|
||||
const [form, setForm] = useState({
|
||||
city: "",
|
||||
date: "",
|
||||
time: "19:00",
|
||||
venue: "",
|
||||
address: "",
|
||||
description: "",
|
||||
maxAttendees: "20",
|
||||
});
|
||||
|
||||
const handleSubmit = (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
setSubmitted(true);
|
||||
};
|
||||
|
||||
if (submitted) {
|
||||
return (
|
||||
<div className="min-h-screen bg-[#fafafa] dark:bg-gray-950">
|
||||
<main className="max-w-[600px] mx-auto px-4 sm:px-6 py-12 sm:py-20">
|
||||
<div className="bg-white dark:bg-gray-900 rounded-2xl shadow-lg border border-gray-100 dark:border-gray-800 p-8 sm:p-12 text-center">
|
||||
<span className="text-6xl mb-6 block">🎉</span>
|
||||
<h2 className="text-xl sm:text-2xl font-bold text-gray-900 dark:text-gray-100 mb-3">
|
||||
{t("successTitle")}
|
||||
</h2>
|
||||
<p className="text-gray-500 dark:text-gray-400 mb-8">
|
||||
{t("successDesc")}
|
||||
</p>
|
||||
<div className="flex flex-col sm:flex-row gap-3 justify-center">
|
||||
<Link
|
||||
href="/meetups/host"
|
||||
onClick={() => setSubmitted(false)}
|
||||
className="px-6 py-3 rounded-xl border border-gray-200 dark:border-gray-700 text-gray-700 dark:text-gray-300 font-medium hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors"
|
||||
>
|
||||
{t("createAnother")}
|
||||
</Link>
|
||||
<Link
|
||||
href="/meetups"
|
||||
className="px-6 py-3 rounded-xl bg-[#ff4d4f] text-white font-medium hover:bg-[#ff7a45] transition-colors"
|
||||
>
|
||||
{t("viewMeetups")}
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-[#fafafa] dark:bg-gray-950">
|
||||
<main className="max-w-[640px] mx-auto px-4 sm:px-6 py-8 sm:py-12">
|
||||
<header className="mb-8">
|
||||
<Link
|
||||
href="/meetups"
|
||||
className="inline-flex items-center gap-1.5 text-sm text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 mb-4"
|
||||
>
|
||||
← {t("backToMeetups")}
|
||||
</Link>
|
||||
<h1 className="text-2xl sm:text-3xl font-bold text-gray-900 dark:text-gray-100 flex items-center gap-2">
|
||||
<span className="w-1 h-8 bg-[#ff4d4f] rounded-full" />
|
||||
{t("title")}
|
||||
</h1>
|
||||
<p className="text-gray-500 dark:text-gray-400 mt-1 text-sm sm:text-base">
|
||||
{t("subtitle")}
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<form
|
||||
onSubmit={handleSubmit}
|
||||
className="bg-white dark:bg-gray-900 rounded-2xl shadow-sm border border-gray-100 dark:border-gray-800 p-6 sm:p-8 space-y-6"
|
||||
>
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
||||
{t("city")} *
|
||||
</label>
|
||||
<select
|
||||
required
|
||||
value={form.city}
|
||||
onChange={(e) => setForm((f) => ({ ...f, city: e.target.value }))}
|
||||
className="form-input w-full border border-gray-200 dark:border-gray-700 rounded-xl px-4 py-3 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100"
|
||||
>
|
||||
<option value="">{t("selectCity")}</option>
|
||||
{CITY_OPTIONS.map((c) => (
|
||||
<option key={c.value} value={c.value}>
|
||||
{c.label}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
||||
{t("date")} *
|
||||
</label>
|
||||
<input
|
||||
type="date"
|
||||
required
|
||||
value={form.date}
|
||||
onChange={(e) => setForm((f) => ({ ...f, date: e.target.value }))}
|
||||
className="form-input w-full border border-gray-200 dark:border-gray-700 rounded-xl px-4 py-3 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
||||
{t("time")} *
|
||||
</label>
|
||||
<input
|
||||
type="time"
|
||||
required
|
||||
value={form.time}
|
||||
onChange={(e) => setForm((f) => ({ ...f, time: e.target.value }))}
|
||||
className="form-input w-full border border-gray-200 dark:border-gray-700 rounded-xl px-4 py-3 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
||||
{t("venue")} *
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
required
|
||||
placeholder={t("venuePlaceholder")}
|
||||
value={form.venue}
|
||||
onChange={(e) => setForm((f) => ({ ...f, venue: e.target.value }))}
|
||||
className="form-input w-full border border-gray-200 dark:border-gray-700 rounded-xl px-4 py-3 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 placeholder-gray-400"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
||||
{t("address")} *
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
required
|
||||
placeholder={t("addressPlaceholder")}
|
||||
value={form.address}
|
||||
onChange={(e) => setForm((f) => ({ ...f, address: e.target.value }))}
|
||||
className="form-input w-full border border-gray-200 dark:border-gray-700 rounded-xl px-4 py-3 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 placeholder-gray-400"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
||||
{t("description")}
|
||||
</label>
|
||||
<textarea
|
||||
rows={4}
|
||||
placeholder={t("descriptionPlaceholder")}
|
||||
value={form.description}
|
||||
onChange={(e) => setForm((f) => ({ ...f, description: e.target.value }))}
|
||||
className="form-input w-full border border-gray-200 dark:border-gray-700 rounded-xl px-4 py-3 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 placeholder-gray-400 resize-none"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
||||
{t("maxAttendees")}
|
||||
</label>
|
||||
<input
|
||||
type="number"
|
||||
min={2}
|
||||
max={100}
|
||||
value={form.maxAttendees}
|
||||
onChange={(e) => setForm((f) => ({ ...f, maxAttendees: e.target.value }))}
|
||||
className="form-input w-full border border-gray-200 dark:border-gray-700 rounded-xl px-4 py-3 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<p className="text-xs text-gray-400 dark:text-gray-500">
|
||||
{t("demoHint")}
|
||||
</p>
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
className="w-full py-3.5 rounded-xl bg-[#ff4d4f] text-white font-semibold hover:bg-[#ff7a45] transition-colors"
|
||||
>
|
||||
{t("submit")}
|
||||
</button>
|
||||
</form>
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useMemo } from "react";
|
||||
import { Link, useTranslation } from "@/i18n/navigation";
|
||||
|
||||
interface Attendee {
|
||||
name: string;
|
||||
@@ -80,6 +81,7 @@ function MeetupCard({ meetup }: { meetup: Meetup }) {
|
||||
}
|
||||
|
||||
export default function MeetupsPage() {
|
||||
const { t } = useTranslation("meetups");
|
||||
const [activeTab, setActiveTab] = useState<"upcoming" | "previous">("upcoming");
|
||||
const upcomingMeetups = useMemo(() => allMeetups.filter((m) => m.isUpcoming), []);
|
||||
const previousMeetups = useMemo(() => allMeetups.filter((m) => !m.isUpcoming), []);
|
||||
@@ -89,22 +91,31 @@ export default function MeetupsPage() {
|
||||
return (
|
||||
<div className="min-h-screen bg-[#fafafa] dark:bg-gray-950">
|
||||
<main className="max-w-[1400px] mx-auto px-4 sm:px-6 md:px-10 py-8 sm:py-12">
|
||||
<header className="mb-8">
|
||||
<h1 className="text-2xl sm:text-3xl font-bold text-gray-900 dark:text-gray-100 flex items-center gap-2">
|
||||
<span className="w-1 h-8 bg-[#ff4d4f] rounded-full" />
|
||||
线下聚会
|
||||
</h1>
|
||||
<p className="text-gray-500 dark:text-gray-400 mt-1 text-sm sm:text-base">
|
||||
与全球数字游民面对面交流,拓展人脉,分享经验
|
||||
</p>
|
||||
<header className="mb-8 flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4">
|
||||
<div>
|
||||
<h1 className="text-2xl sm:text-3xl font-bold text-gray-900 dark:text-gray-100 flex items-center gap-2">
|
||||
<span className="w-1 h-8 bg-[#ff4d4f] rounded-full" />
|
||||
{t("title")}
|
||||
</h1>
|
||||
<p className="text-gray-500 dark:text-gray-400 mt-1 text-sm sm:text-base">
|
||||
{t("subtitle")}
|
||||
</p>
|
||||
</div>
|
||||
<Link
|
||||
href="/meetups/host"
|
||||
className="shrink-0 inline-flex items-center gap-2 px-4 py-2.5 rounded-xl bg-[#ff4d4f] text-white text-sm font-medium hover:bg-[#ff7a45] transition-colors"
|
||||
>
|
||||
<span>🎤</span>
|
||||
{t("hostMeetup")}
|
||||
</Link>
|
||||
</header>
|
||||
|
||||
<div className="flex gap-1 p-1 bg-white dark:bg-gray-900 rounded-xl shadow-sm border border-gray-100 dark:border-gray-800 mb-8 inline-flex">
|
||||
<button onClick={() => setActiveTab("upcoming")} className={`px-5 py-2.5 rounded-lg text-sm font-medium transition-all ${activeTab === "upcoming" ? "bg-[#ff4d4f] text-white shadow-sm" : "text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-50 dark:hover:bg-gray-800"}`}>
|
||||
即将举办
|
||||
{t("upcoming")}
|
||||
</button>
|
||||
<button onClick={() => setActiveTab("previous")} className={`px-5 py-2.5 rounded-lg text-sm font-medium transition-all ${activeTab === "previous" ? "bg-[#ff4d4f] text-white shadow-sm" : "text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-50 dark:hover:bg-gray-800"}`}>
|
||||
往期聚会
|
||||
{t("previous")}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ export default function Home() {
|
||||
/>
|
||||
))}
|
||||
<div className="w-full mt-0.5 text-[9px] sm:text-xs text-gray-400 dark:text-gray-500 text-center">
|
||||
{locale === "zh" ? "本月 86 人加入" : "86 joined this month"}
|
||||
{t("joinedThisMonthShort")}
|
||||
</div>
|
||||
</div>
|
||||
</Link>
|
||||
@@ -137,13 +137,13 @@ export default function Home() {
|
||||
<div className="right-item-header">{t("latestEvents")}</div>
|
||||
<div className="p-1.5 sm:p-4 flex flex-col gap-0.5 sm:gap-2.5 text-[10px] sm:text-sm text-gray-700 dark:text-gray-300 h-[calc(100%-38px)] sm:h-[calc(100%-42px)]">
|
||||
<div className="flex items-center gap-1 bg-[#f5f6f7] dark:bg-gray-800 rounded-lg px-1.5 py-1 sm:px-3 sm:py-2 font-medium text-gray-900 dark:text-gray-100">
|
||||
🗓 3月15日
|
||||
🗓 {t("meetupDate")}
|
||||
</div>
|
||||
<div className="flex items-center gap-1 bg-[#f5f6f7] dark:bg-gray-800 rounded-lg px-1.5 py-1 sm:px-3 sm:py-2 font-medium text-gray-900 dark:text-gray-100">
|
||||
📍 深圳南山
|
||||
📍 {t("meetupLocation")}
|
||||
</div>
|
||||
<div className="flex items-center gap-1 bg-[#f5f6f7] dark:bg-gray-800 rounded-lg px-1.5 py-1 sm:px-3 sm:py-2 font-medium text-gray-900 dark:text-gray-100">
|
||||
👥 12{t("people")}
|
||||
👥 {t("meetupPeople")}
|
||||
</div>
|
||||
<div className="flex -space-x-1 mt-auto">
|
||||
{memberPhotos.slice(0, 5).map((m) => (
|
||||
|
||||
109
app/[locale]/report/data/page.tsx
Normal file
109
app/[locale]/report/data/page.tsx
Normal file
@@ -0,0 +1,109 @@
|
||||
"use client";
|
||||
|
||||
import { useTheme } from "@/app/context/ThemeContext";
|
||||
import { useLocale, useTranslation } from "@/i18n/navigation";
|
||||
import { Link } from "@/i18n/navigation";
|
||||
import { MembersMap, BarChart, PieChart, LineChart } from "@/app/lib/charts";
|
||||
import { MAP_CITIES } from "@/app/data/map-cities";
|
||||
|
||||
// 演示数据
|
||||
const getCityBarData = (locale: "zh" | "en") =>
|
||||
[...MAP_CITIES]
|
||||
.sort((a, b) => b.nomadsNow - a.nomadsNow)
|
||||
.slice(0, 10)
|
||||
.map((c) => ({ name: locale === "zh" ? c.name : c.nameEn, value: c.nomadsNow }));
|
||||
|
||||
const REGION_PIE_DATA = [
|
||||
{ name: "华东", value: 3200 },
|
||||
{ name: "华南", value: 1800 },
|
||||
{ name: "西南", value: 2100 },
|
||||
{ name: "华北", value: 1200 },
|
||||
{ name: "其他", value: 700 },
|
||||
];
|
||||
|
||||
const GROWTH_LINE_DATA = {
|
||||
xAxis: ["1月", "2月", "3月", "4月", "5月", "6月"],
|
||||
series: [
|
||||
{ name: "新增成员", data: [320, 480, 520, 610, 720, 850] },
|
||||
{ name: "活跃城市", data: [12, 14, 15, 16, 17, 18] },
|
||||
],
|
||||
};
|
||||
|
||||
export default function DataReportPage() {
|
||||
const { t } = useTranslation("dataReport");
|
||||
const locale = useLocale();
|
||||
const { theme } = useTheme();
|
||||
const dark = theme === "dark";
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-[#fafafa] dark:bg-gray-950">
|
||||
<main className="max-w-[1400px] mx-auto px-4 sm:px-6 py-8 sm:py-12">
|
||||
<header className="mb-8 flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4">
|
||||
<div>
|
||||
<Link
|
||||
href="/report"
|
||||
className="inline-flex items-center gap-1.5 text-sm text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 mb-2"
|
||||
>
|
||||
← {t("backToReport")}
|
||||
</Link>
|
||||
<h1 className="text-2xl sm:text-3xl font-bold text-gray-900 dark:text-gray-100 flex items-center gap-2">
|
||||
<span className="w-1 h-8 bg-[#ff4d4f] rounded-full" />
|
||||
{t("title")}
|
||||
</h1>
|
||||
<p className="text-gray-500 dark:text-gray-400 mt-1 text-sm sm:text-base">
|
||||
{t("subtitle")}
|
||||
</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div className="space-y-8">
|
||||
{/* 成员地图 */}
|
||||
<section className="bg-white dark:bg-gray-900 rounded-2xl shadow-sm border border-gray-100 dark:border-gray-800 overflow-hidden p-4 sm:p-6">
|
||||
<h2 className="text-lg font-bold text-gray-900 dark:text-gray-100 mb-4">
|
||||
{t("membersMap")}
|
||||
</h2>
|
||||
<div className="rounded-xl overflow-hidden bg-gray-50 dark:bg-gray-800/50">
|
||||
<MembersMap
|
||||
data={MAP_CITIES}
|
||||
locale={locale}
|
||||
dark={dark}
|
||||
className="min-h-[400px]"
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/* 图表网格 */}
|
||||
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
|
||||
<section className="bg-white dark:bg-gray-900 rounded-2xl shadow-sm border border-gray-100 dark:border-gray-800 p-4 sm:p-6">
|
||||
<BarChart
|
||||
data={getCityBarData(locale)}
|
||||
title={t("cityRanking")}
|
||||
dark={dark}
|
||||
/>
|
||||
</section>
|
||||
|
||||
<section className="bg-white dark:bg-gray-900 rounded-2xl shadow-sm border border-gray-100 dark:border-gray-800 p-4 sm:p-6">
|
||||
<PieChart
|
||||
data={REGION_PIE_DATA}
|
||||
title={t("regionDist")}
|
||||
dark={dark}
|
||||
/>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<section className="bg-white dark:bg-gray-900 rounded-2xl shadow-sm border border-gray-100 dark:border-gray-800 p-4 sm:p-6">
|
||||
<LineChart
|
||||
data={GROWTH_LINE_DATA}
|
||||
title={t("growthTrend")}
|
||||
dark={dark}
|
||||
/>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<p className="text-xs text-gray-400 dark:text-gray-500 mt-8 text-center">
|
||||
{t("demoHint")}
|
||||
</p>
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import { useTranslation } from "@/i18n/navigation";
|
||||
import { Link, useTranslation } from "@/i18n/navigation";
|
||||
import Footer from "@/app/components/Footer";
|
||||
|
||||
export default function ReportPage() {
|
||||
@@ -18,6 +18,12 @@ export default function ReportPage() {
|
||||
<p className="mt-2 text-gray-500 dark:text-gray-400">
|
||||
{t("subtitle")}
|
||||
</p>
|
||||
<Link
|
||||
href="/report/data"
|
||||
className="inline-flex items-center gap-2 mt-4 px-4 py-2 rounded-xl border border-gray-200 dark:border-gray-700 text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors"
|
||||
>
|
||||
📊 {t("dataReport")}
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
{!generated ? (
|
||||
|
||||
Reference in New Issue
Block a user