s''
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useMemo } from "react";
|
||||
import { useEffect, useState, useMemo } from "react";
|
||||
import { Link, useLocale, useRouter } from "@/i18n/navigation";
|
||||
import { useTranslation } from "@/i18n/navigation";
|
||||
import HeroSection from "../components/HeroSection";
|
||||
@@ -10,25 +10,241 @@ import CityModal from "../components/CityModal";
|
||||
import Footer from "@/app/components/Footer";
|
||||
import { cities, type City } from "../data/cities";
|
||||
import { HOME_CONFIG } from "@/config";
|
||||
import { apiFetch } from "@/app/lib/api-client";
|
||||
|
||||
const { memberPhotos, travelingNow, meetups: homeMeetups, hotTopics, routes, stats, communityStats } = HOME_CONFIG;
|
||||
const {
|
||||
memberPhotos: fallbackMemberPhotos,
|
||||
travelingNow: fallbackTravelingNow,
|
||||
meetups: fallbackHomeMeetups,
|
||||
hotTopics: fallbackHotTopics,
|
||||
routes: fallbackRoutes,
|
||||
stats: fallbackStats,
|
||||
communityStats: fallbackCommunityStats,
|
||||
} = HOME_CONFIG;
|
||||
|
||||
interface ContentItem {
|
||||
slug: string;
|
||||
type: "ebook" | "video" | "app" | "guide";
|
||||
title: string;
|
||||
titleEn?: string;
|
||||
subtitle: string;
|
||||
subtitleEn?: string;
|
||||
description?: string;
|
||||
coverImage: string;
|
||||
targetUrl: string;
|
||||
ctaLabel: string;
|
||||
ctaLabelEn?: string;
|
||||
durationMinutes?: number;
|
||||
}
|
||||
|
||||
const FALLBACK_HOME_CONTENT: ContentItem[] = [
|
||||
{
|
||||
slug: "nomad-china-playbook",
|
||||
type: "ebook",
|
||||
title: "《中国数字游民落地手册》",
|
||||
titleEn: "China Digital Nomad Playbook",
|
||||
subtitle: "选城、预算、租房和社群融入的一本实操指南",
|
||||
subtitleEn: "A practical guide for city choice, budget, housing, and community.",
|
||||
coverImage: "https://images.unsplash.com/photo-1519389950473-47ba0277781c?w=1200",
|
||||
targetUrl: "/ebooks/nomad-china-playbook",
|
||||
ctaLabel: "查看电子书",
|
||||
ctaLabelEn: "View ebook",
|
||||
},
|
||||
{
|
||||
slug: "lin-dali-documentary",
|
||||
type: "video",
|
||||
title: "林晓雨:在大理远程工作的现实一天",
|
||||
titleEn: "A remote work day in Dali",
|
||||
subtitle: "个人访谈 / 现实纪录片",
|
||||
subtitleEn: "Interview documentary",
|
||||
coverImage: "https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?w=1200",
|
||||
targetUrl: "/videos/lin-dali-documentary",
|
||||
ctaLabel: "观看访谈",
|
||||
ctaLabelEn: "Watch",
|
||||
},
|
||||
{
|
||||
slug: "nomadcna-app",
|
||||
type: "app",
|
||||
title: "NomadCNA App",
|
||||
titleEn: "NomadCNA App",
|
||||
subtitle: "记录旅居路线、发现同城活动、保存城市清单",
|
||||
subtitleEn: "Track routes, discover meetups, and save city lists.",
|
||||
coverImage: "https://images.unsplash.com/photo-1516321318423-f06f85e504b3?w=1200",
|
||||
targetUrl: "/app",
|
||||
ctaLabel: "下载 App",
|
||||
ctaLabelEn: "Download app",
|
||||
},
|
||||
{
|
||||
slug: "digital-nomad-guide",
|
||||
type: "guide",
|
||||
title: "数字游民指南",
|
||||
titleEn: "Digital Nomad Guide",
|
||||
subtitle: "完整方法论、工具、案例和长期更新",
|
||||
subtitleEn: "Methods, tools, cases, and long-term updates.",
|
||||
coverImage: "https://images.unsplash.com/photo-1499750310107-5fef28a66643?w=1200",
|
||||
targetUrl: "https://digital.hackrobot.cn/zh",
|
||||
ctaLabel: "打开指南",
|
||||
ctaLabelEn: "Open guide",
|
||||
},
|
||||
];
|
||||
|
||||
interface ProfileItem {
|
||||
id: string;
|
||||
name: string;
|
||||
location?: string;
|
||||
photo: string;
|
||||
}
|
||||
|
||||
interface MeetupItem {
|
||||
id: string;
|
||||
city: string;
|
||||
emoji?: string;
|
||||
date?: string;
|
||||
time?: string;
|
||||
rsvpCount?: number;
|
||||
venue?: string;
|
||||
}
|
||||
|
||||
interface TopicItem {
|
||||
id: string;
|
||||
title: string;
|
||||
titleEn?: string;
|
||||
views: number;
|
||||
}
|
||||
|
||||
interface RouteItem {
|
||||
id?: string;
|
||||
slug: string;
|
||||
title: string;
|
||||
titleEn?: string;
|
||||
durationDays: number;
|
||||
budget: number;
|
||||
description: string;
|
||||
descriptionEn?: string;
|
||||
stops?: string[];
|
||||
cities?: City[];
|
||||
}
|
||||
|
||||
interface HomeStats {
|
||||
cities: string;
|
||||
nomads: string;
|
||||
homeMeetups: string;
|
||||
cost: string;
|
||||
}
|
||||
|
||||
function safetyOrder(s: string): number {
|
||||
const o: Record<string, number> = { 极好: 5, 很好: 4, 好: 3, 一般: 2, 差: 1 };
|
||||
return o[s] || 0;
|
||||
}
|
||||
|
||||
function shortDate(date?: string): string {
|
||||
if (!date) return "时间待定";
|
||||
const month = Number(date.slice(5, 7));
|
||||
const day = Number(date.slice(8, 10));
|
||||
return `${month}月${day}日`;
|
||||
}
|
||||
|
||||
export default function Home() {
|
||||
const [activeFilter, setActiveFilter] = useState("全部");
|
||||
const [sortBy, setSortBy] = useState("score");
|
||||
const [cityModal, setCityModal] = useState<City | null>(null);
|
||||
const [liveCities, setLiveCities] = useState<City[]>(cities);
|
||||
const [homeContent, setHomeContent] = useState<ContentItem[]>(FALLBACK_HOME_CONTENT);
|
||||
const [homeStats, setHomeStats] = useState<HomeStats>(fallbackStats);
|
||||
const [memberPhotos, setMemberPhotos] = useState(fallbackMemberPhotos);
|
||||
const [travelingNow, setTravelingNow] = useState(fallbackTravelingNow);
|
||||
const [homeMeetups, setHomeMeetups] = useState(fallbackHomeMeetups);
|
||||
const [hotTopics, setHotTopics] = useState(fallbackHotTopics);
|
||||
const [routes, setRoutes] = useState<RouteItem[]>([]);
|
||||
const [communityStats, setCommunityStats] = useState(fallbackCommunityStats);
|
||||
const locale = useLocale();
|
||||
const router = useRouter();
|
||||
const { t } = useTranslation("home");
|
||||
const { t: tNav } = useTranslation("nav");
|
||||
|
||||
useEffect(() => {
|
||||
apiFetch<{ ok: boolean; items: City[] }>("/api/cities")
|
||||
.then((data) => {
|
||||
if (data.items?.length) {
|
||||
setLiveCities(data.items.map((item) => ({ ...item, id: Number((item as unknown as { idNumber?: number }).idNumber || item.id) })));
|
||||
}
|
||||
})
|
||||
.catch(() => setLiveCities(cities));
|
||||
apiFetch<{ ok: boolean; items: ContentItem[] }>("/api/content/home")
|
||||
.then((data) => setHomeContent(data.items?.length ? data.items : FALLBACK_HOME_CONTENT))
|
||||
.catch(() => setHomeContent(FALLBACK_HOME_CONTENT));
|
||||
apiFetch<{ stats: { cities: number; nomads: number; meetups: number; minCost: number; profiles: number; discussions: number } }>("/api/stats/overview")
|
||||
.then((data) => {
|
||||
setHomeStats({
|
||||
cities: data.stats.cities.toLocaleString(),
|
||||
nomads: data.stats.nomads.toLocaleString(),
|
||||
homeMeetups: data.stats.meetups.toLocaleString(),
|
||||
cost: `¥${data.stats.minCost.toLocaleString()}`,
|
||||
});
|
||||
setCommunityStats({
|
||||
onlineMembers: `${data.stats.profiles.toLocaleString()}+`,
|
||||
messagesPerMonth: `${Math.max(data.stats.discussions * 180, 1).toLocaleString()}+`,
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
setHomeStats(fallbackStats);
|
||||
setCommunityStats(fallbackCommunityStats);
|
||||
});
|
||||
apiFetch<{ items: ProfileItem[] }>("/api/profiles")
|
||||
.then((data) => {
|
||||
const profiles = (data.items || []).slice(0, 12);
|
||||
if (profiles.length) {
|
||||
setMemberPhotos(profiles.map((profile) => ({ name: profile.name, photo: profile.photo })));
|
||||
setTravelingNow(
|
||||
profiles.map((profile) => ({
|
||||
name: profile.name,
|
||||
photo: profile.photo,
|
||||
dest: profile.location || "远程",
|
||||
}))
|
||||
);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
setMemberPhotos(fallbackMemberPhotos);
|
||||
setTravelingNow(fallbackTravelingNow);
|
||||
});
|
||||
apiFetch<{ items: MeetupItem[] }>("/api/meetups")
|
||||
.then((data) => {
|
||||
const meetups = (data.items || []).slice(0, 6);
|
||||
if (meetups.length) {
|
||||
setHomeMeetups(
|
||||
meetups.map((meetup) => ({
|
||||
city: meetup.city,
|
||||
emoji: meetup.emoji || "📍",
|
||||
date: shortDate(meetup.date),
|
||||
count: Number(meetup.rsvpCount || 0),
|
||||
}))
|
||||
);
|
||||
}
|
||||
})
|
||||
.catch(() => setHomeMeetups(fallbackHomeMeetups));
|
||||
apiFetch<{ items: TopicItem[] }>("/api/discussions")
|
||||
.then((data) => {
|
||||
const topics = [...(data.items || [])]
|
||||
.sort((a, b) => Number(b.views || 0) - Number(a.views || 0))
|
||||
.slice(0, 5);
|
||||
if (topics.length) {
|
||||
setHotTopics(
|
||||
topics.map((topic) => ({
|
||||
titleZh: topic.title,
|
||||
titleEn: topic.titleEn || topic.title,
|
||||
views: Number(topic.views || 0),
|
||||
}))
|
||||
);
|
||||
}
|
||||
})
|
||||
.catch(() => setHotTopics(fallbackHotTopics));
|
||||
apiFetch<{ items: RouteItem[] }>("/api/routes")
|
||||
.then((data) => setRoutes(data.items || []))
|
||||
.catch(() => setRoutes([]));
|
||||
}, []);
|
||||
|
||||
const filteredCities = useMemo(() => {
|
||||
let result = [...cities];
|
||||
let result = [...liveCities];
|
||||
if (activeFilter !== "全部") {
|
||||
result = result.filter((c) => c.tags.includes(activeFilter));
|
||||
}
|
||||
@@ -51,7 +267,27 @@ export default function Home() {
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}, [activeFilter, sortBy]);
|
||||
}, [activeFilter, sortBy, liveCities]);
|
||||
|
||||
const displayRoutes = routes.length
|
||||
? routes
|
||||
: fallbackRoutes.map((route, index) => ({
|
||||
id: `fallback-${index}`,
|
||||
slug: route.titleEn.toLowerCase().replace(/[^a-z0-9]+/g, "-"),
|
||||
title: route.titleZh,
|
||||
titleEn: route.titleEn,
|
||||
durationDays: Number(route.durationZh.match(/\d+/)?.[0] || 30),
|
||||
budget: Number(route.costZh.replace(/[^\d]/g, "")) || 3000,
|
||||
description: route.descZh,
|
||||
descriptionEn: route.descEn,
|
||||
stops: route.citiesZh,
|
||||
cities: route.citiesZh.map((name, i) => ({
|
||||
id: i,
|
||||
name,
|
||||
nameEn: route.citiesEn[i],
|
||||
icon: route.emojis[i],
|
||||
} as City)),
|
||||
}));
|
||||
|
||||
const cityTags = [
|
||||
{ key: "dali", emoji: "🏯", zh: "大理", en: "Dali" },
|
||||
@@ -67,22 +303,22 @@ export default function Home() {
|
||||
<div className="border-y border-gray-100 dark:border-gray-800 bg-white dark:bg-gray-900">
|
||||
<div className="max-w-[1400px] mx-auto px-5 sm:px-10 py-4 flex flex-wrap items-center justify-center gap-6 sm:gap-12 text-center">
|
||||
<div>
|
||||
<span className="text-xl sm:text-2xl font-bold text-gray-900 dark:text-gray-100">{stats.cities}</span>
|
||||
<span className="text-xl sm:text-2xl font-bold text-gray-900 dark:text-gray-100">{homeStats.cities}</span>
|
||||
<p className="text-xs text-gray-400 dark:text-gray-500 mt-0.5">{t("stats.cities")}</p>
|
||||
</div>
|
||||
<div className="w-px h-8 bg-gray-100 dark:bg-gray-700 hidden sm:block" />
|
||||
<div>
|
||||
<span className="text-xl sm:text-2xl font-bold text-gray-900 dark:text-gray-100">{stats.nomads}</span>
|
||||
<span className="text-xl sm:text-2xl font-bold text-gray-900 dark:text-gray-100">{homeStats.nomads}</span>
|
||||
<p className="text-xs text-gray-400 dark:text-gray-500 mt-0.5">{t("stats.nomads")}</p>
|
||||
</div>
|
||||
<div className="w-px h-8 bg-gray-100 dark:bg-gray-700 hidden sm:block" />
|
||||
<div>
|
||||
<span className="text-xl sm:text-2xl font-bold text-gray-900 dark:text-gray-100">{stats.homeMeetups}</span>
|
||||
<span className="text-xl sm:text-2xl font-bold text-gray-900 dark:text-gray-100">{homeStats.homeMeetups}</span>
|
||||
<p className="text-xs text-gray-400 dark:text-gray-500 mt-0.5">{t("stats.meetups")}</p>
|
||||
</div>
|
||||
<div className="w-px h-8 bg-gray-100 dark:bg-gray-700 hidden sm:block" />
|
||||
<div>
|
||||
<span className="text-xl sm:text-2xl font-bold text-gray-900 dark:text-gray-100">{stats.cost}</span>
|
||||
<span className="text-xl sm:text-2xl font-bold text-gray-900 dark:text-gray-100">{homeStats.cost}</span>
|
||||
<p className="text-xs text-gray-400 dark:text-gray-500 mt-0.5">{t("stats.cost")}</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -99,7 +335,59 @@ export default function Home() {
|
||||
</div>
|
||||
|
||||
<div className="items-grid">
|
||||
<Link href="/join" className="right-item block">
|
||||
{homeContent.slice(0, 4).map((item, index) => {
|
||||
const isExternal = item.targetUrl.startsWith("http");
|
||||
const title = locale === "zh" ? item.title : item.titleEn || item.title;
|
||||
const subtitle = locale === "zh" ? item.subtitle : item.subtitleEn || item.subtitle;
|
||||
const cta = locale === "zh" ? item.ctaLabel : item.ctaLabelEn || item.ctaLabel;
|
||||
const typeMeta: Record<string, { header: string; icon: string; href: string }> = {
|
||||
ebook: { header: "电子书", icon: "📘", href: `/ebooks/${item.slug}` },
|
||||
video: { header: "访谈视频", icon: "▶️", href: `/videos/${item.slug}` },
|
||||
app: { header: "App", icon: "📱", href: "/app" },
|
||||
guide: { header: "数字游民指南", icon: "🧭", href: item.targetUrl },
|
||||
};
|
||||
const meta = typeMeta[item.type] || typeMeta.guide;
|
||||
const content = (
|
||||
<>
|
||||
<div className="right-item-header">{meta.header}</div>
|
||||
<div className="relative h-[calc(100%-38px)] sm:h-[calc(100%-42px)] overflow-hidden">
|
||||
<img src={item.coverImage} alt={title} className="absolute inset-0 h-full w-full object-cover" />
|
||||
<div className="absolute inset-0 bg-gradient-to-t from-black/75 via-black/35 to-transparent" />
|
||||
<div className="absolute inset-x-0 bottom-0 p-3 sm:p-4 text-white">
|
||||
<div className="mb-1 text-xl sm:text-2xl">{meta.icon}</div>
|
||||
<h3 className="line-clamp-2 text-xs sm:text-sm font-bold leading-snug">{title}</h3>
|
||||
<p className="mt-1 line-clamp-2 text-[10px] sm:text-xs text-white/80">{subtitle}</p>
|
||||
<span className="mt-2 inline-flex rounded-full bg-white/90 px-2.5 py-1 text-[10px] sm:text-xs font-semibold text-gray-900">
|
||||
{cta}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
return isExternal ? (
|
||||
<a
|
||||
key={item.slug}
|
||||
href={meta.href}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="right-item block"
|
||||
style={{ gridColumn: "-2 / -1", gridRow: index + 1 }}
|
||||
>
|
||||
{content}
|
||||
</a>
|
||||
) : (
|
||||
<Link
|
||||
key={item.slug}
|
||||
href={meta.href}
|
||||
className="right-item block"
|
||||
style={{ gridColumn: "-2 / -1", gridRow: index + 1 }}
|
||||
>
|
||||
{content}
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
|
||||
<Link href="/join" className="right-item block" style={{ gridColumn: "-2 / -1", gridRow: 5 }}>
|
||||
<div className="right-item-header">{t("joinCommunity")}</div>
|
||||
<div className="flex flex-col items-center justify-center text-center p-2 sm:p-5 h-[calc(100%-38px)] sm:h-[calc(100%-42px)]">
|
||||
<span className="text-2xl sm:text-5xl mb-1 sm:mb-3">💬</span>
|
||||
@@ -115,7 +403,7 @@ export default function Home() {
|
||||
</div>
|
||||
</Link>
|
||||
|
||||
<Link href="/dating" className="right-item block">
|
||||
<Link href="/dating" className="right-item block" style={{ gridColumn: "-2 / -1", gridRow: 6 }}>
|
||||
<div className="right-item-header">{t("newMembers")}</div>
|
||||
<div className="p-2 sm:p-5 flex flex-wrap gap-1 sm:gap-2 content-start">
|
||||
{memberPhotos.map((m) => (
|
||||
@@ -133,18 +421,18 @@ export default function Home() {
|
||||
</div>
|
||||
</Link>
|
||||
|
||||
<Link href="/meetups" className="right-item block">
|
||||
<Link href="/meetups" className="right-item block" style={{ gridColumn: "-2 / -1", gridRow: 7 }}>
|
||||
<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">
|
||||
🗓 {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">
|
||||
👥 {t("meetupPeople")}
|
||||
</div>
|
||||
{homeMeetups.slice(0, 3).map((meetup) => (
|
||||
<div
|
||||
key={`${meetup.city}-${meetup.date}`}
|
||||
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"
|
||||
>
|
||||
<span>{meetup.emoji}</span>
|
||||
<span className="line-clamp-1">{meetup.city} · {meetup.date} · {meetup.count}{t("people")}</span>
|
||||
</div>
|
||||
))}
|
||||
<div className="flex -space-x-1 mt-auto">
|
||||
{memberPhotos.slice(0, 5).map((m) => (
|
||||
<img
|
||||
@@ -189,41 +477,41 @@ export default function Home() {
|
||||
{t("hotRoutes")}
|
||||
</h2>
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 sm:gap-5">
|
||||
{routes.map((route) => (
|
||||
{displayRoutes.map((route) => (
|
||||
<Link
|
||||
key={route.titleZh}
|
||||
href={`/dashboard?route=${encodeURIComponent(locale === "zh" ? route.titleZh : route.titleEn)}`}
|
||||
key={route.slug}
|
||||
href={`/dashboard?route=${encodeURIComponent(route.slug)}`}
|
||||
className="community-card group cursor-pointer block"
|
||||
>
|
||||
<div className={`h-2 bg-gradient-to-r ${route.gradient}`} />
|
||||
<div className="h-2 bg-gradient-to-r from-[#ff4d4f] to-[#ff7a45]" />
|
||||
<div className="p-4 sm:p-5">
|
||||
<div className="flex items-center justify-between mb-3">
|
||||
<h3 className="font-bold text-gray-900 dark:text-gray-100 text-sm">
|
||||
{locale === "zh" ? route.titleZh : route.titleEn}
|
||||
{locale === "zh" ? route.title : route.titleEn || route.title}
|
||||
</h3>
|
||||
<span className="text-[11px] text-gray-400 dark:text-gray-500 bg-gray-50 dark:bg-gray-800 rounded-full px-2 py-0.5">
|
||||
{locale === "zh" ? route.durationZh : route.durationEn}
|
||||
{route.durationDays} 天
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-1 mb-3">
|
||||
{route.emojis.map((emoji, i) => (
|
||||
{(route.cities || []).slice(0, 4).map((city, i) => (
|
||||
<span key={i} className="flex items-center gap-0.5 text-sm">
|
||||
<span>{emoji}</span>
|
||||
<span>{city.icon || "📍"}</span>
|
||||
<span className="font-medium text-gray-700 dark:text-gray-300">
|
||||
{locale === "zh" ? route.citiesZh[i] : route.citiesEn[i]}
|
||||
{locale === "zh" ? city.name : city.nameEn || city.name}
|
||||
</span>
|
||||
{i < route.emojis.length - 1 && (
|
||||
{i < (route.cities || []).slice(0, 4).length - 1 && (
|
||||
<span className="text-gray-300 dark:text-gray-600 mx-1">→</span>
|
||||
)}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
<p className="text-xs text-gray-500 dark:text-gray-400 mb-3 leading-relaxed">
|
||||
{locale === "zh" ? route.descZh : route.descEn}
|
||||
{locale === "zh" ? route.description : route.descriptionEn || route.description}
|
||||
</p>
|
||||
<div className="flex items-center justify-between">
|
||||
<span className="text-sm font-semibold text-gray-900 dark:text-gray-100">
|
||||
{locale === "zh" ? route.costZh : route.costEn}
|
||||
¥{route.budget.toLocaleString()}
|
||||
</span>
|
||||
<span className="text-xs text-[#ff4d4f] font-medium group-hover:translate-x-1 transition-transform">
|
||||
{t("routeDetails")}
|
||||
@@ -285,7 +573,7 @@ export default function Home() {
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{travelingNow.map((m) => (
|
||||
{travelingNow.slice(0, 16).map((m) => (
|
||||
<img
|
||||
key={m.name}
|
||||
src={m.photo}
|
||||
@@ -304,7 +592,7 @@ export default function Home() {
|
||||
🔥 {t("hotDiscussions")}
|
||||
</h3>
|
||||
<div className="space-y-3">
|
||||
{hotTopics.map((t_item, i) => (
|
||||
{hotTopics.slice(0, 5).map((t_item, i) => (
|
||||
<div key={t_item.titleZh} className="flex items-start gap-2.5 group">
|
||||
<span className={`text-xs font-bold mt-0.5 w-4 shrink-0 ${i < 3 ? "text-[#ff4d4f]" : "text-gray-300 dark:text-gray-600"}`}>
|
||||
{i + 1}
|
||||
|
||||
Reference in New Issue
Block a user