's'
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
"use client";
|
||||
|
||||
import { use } from "react";
|
||||
import { useTranslation, Link } from "@/i18n/navigation";
|
||||
import { use, useEffect, useMemo, useState } from "react";
|
||||
import { Link } from "@/i18n/navigation";
|
||||
import Footer from "@/app/components/Footer";
|
||||
import { apiFetch } from "@/app/lib/api-client";
|
||||
|
||||
interface CityGuide {
|
||||
slug: string;
|
||||
@@ -149,11 +150,134 @@ const CITY_GUIDES: CityGuide[] = [
|
||||
},
|
||||
];
|
||||
|
||||
type CityApiRecord = {
|
||||
name?: string;
|
||||
nameEn?: string;
|
||||
icon?: string;
|
||||
description?: string;
|
||||
costPerMonth?: number;
|
||||
internetSpeed?: number;
|
||||
nomadsNow?: number;
|
||||
tags?: string[];
|
||||
};
|
||||
|
||||
type CityDetailRecord = {
|
||||
guide?: {
|
||||
summary?: string;
|
||||
arrivalChecklist?: string[];
|
||||
workSetup?: string;
|
||||
bestFor?: string[];
|
||||
};
|
||||
cost?: {
|
||||
breakdown?: Array<{ label?: string; amount?: number }>;
|
||||
monthlyTotal?: number;
|
||||
tip?: string;
|
||||
};
|
||||
pros?: {
|
||||
pros?: string[];
|
||||
cons?: string[];
|
||||
};
|
||||
};
|
||||
|
||||
function mergeCityGuide(slug: string, apiCity?: CityApiRecord | null, detail?: CityDetailRecord | null): CityGuide | null {
|
||||
const fallback = CITY_GUIDES.find((c) => c.slug === slug);
|
||||
if (!apiCity && !fallback) return null;
|
||||
|
||||
const breakdown = detail?.cost?.breakdown || [];
|
||||
const costOfLiving =
|
||||
breakdown.length > 0
|
||||
? breakdown.map((item) => ({
|
||||
item: String(item.label || "项目"),
|
||||
priceZh: item.amount ? `¥${Number(item.amount).toLocaleString("zh-CN")}/月` : "—",
|
||||
priceEn: item.amount ? `¥${Number(item.amount).toLocaleString("en-US")}/month` : "—",
|
||||
}))
|
||||
: fallback?.costOfLiving || [];
|
||||
|
||||
const tips =
|
||||
(detail?.guide?.arrivalChecklist?.length ? detail.guide.arrivalChecklist : null) ||
|
||||
fallback?.tips ||
|
||||
[];
|
||||
|
||||
return {
|
||||
slug,
|
||||
nameZh: apiCity?.name || fallback?.nameZh || slug,
|
||||
nameEn: apiCity?.nameEn || fallback?.nameEn || slug,
|
||||
emoji: apiCity?.icon || fallback?.emoji || "🏙️",
|
||||
descriptionZh:
|
||||
detail?.guide?.summary ||
|
||||
apiCity?.description ||
|
||||
fallback?.descriptionZh ||
|
||||
"",
|
||||
descriptionEn: fallback?.descriptionEn || "",
|
||||
costOfLiving,
|
||||
coworking: fallback?.coworking || [],
|
||||
neighborhoods:
|
||||
detail?.pros?.pros?.length || detail?.pros?.cons?.length
|
||||
? [
|
||||
...(detail?.pros?.pros || []).slice(0, 2).map((pros, index) => ({
|
||||
name: `优势 ${index + 1}`,
|
||||
pros,
|
||||
cons: detail?.pros?.cons?.[index] || "—",
|
||||
})),
|
||||
]
|
||||
: fallback?.neighborhoods || [],
|
||||
tips,
|
||||
};
|
||||
}
|
||||
|
||||
export default function CityGuidePage({ params }: { params: Promise<{ slug: string }> }) {
|
||||
const { slug } = use(params);
|
||||
const { t } = useTranslation("cityGuide");
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [apiError, setApiError] = useState(false);
|
||||
const [apiCity, setApiCity] = useState<CityApiRecord | null>(null);
|
||||
const [apiDetail, setApiDetail] = useState<CityDetailRecord | null>(null);
|
||||
|
||||
const city = CITY_GUIDES.find((c) => c.slug === slug);
|
||||
useEffect(() => {
|
||||
let cancelled = false;
|
||||
apiFetch<{
|
||||
city?: CityApiRecord;
|
||||
detail?: CityDetailRecord | null;
|
||||
}>(`/api/cities/${slug}`)
|
||||
.then((data) => {
|
||||
if (cancelled) return;
|
||||
setApiCity(data.city || null);
|
||||
setApiDetail(data.detail || null);
|
||||
setApiError(false);
|
||||
})
|
||||
.catch(() => {
|
||||
if (!cancelled) setApiError(true);
|
||||
})
|
||||
.finally(() => {
|
||||
if (!cancelled) setLoading(false);
|
||||
});
|
||||
return () => {
|
||||
cancelled = true;
|
||||
};
|
||||
}, [slug]);
|
||||
|
||||
const city = useMemo(
|
||||
() => mergeCityGuide(slug, apiCity, apiDetail),
|
||||
[slug, apiCity, apiDetail]
|
||||
);
|
||||
|
||||
if (loading) {
|
||||
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-6 sm:py-8">
|
||||
<div className="h-4 w-24 animate-pulse rounded bg-gray-200 dark:bg-gray-800" />
|
||||
<div className="mt-4 overflow-hidden rounded-2xl bg-white shadow-lg dark:bg-gray-900">
|
||||
<div className="h-40 animate-pulse bg-gray-200 dark:bg-gray-800" />
|
||||
<div className="space-y-4 p-6 sm:p-8">
|
||||
<div className="h-6 w-2/3 animate-pulse rounded bg-gray-200 dark:bg-gray-800" />
|
||||
<div className="h-4 w-full animate-pulse rounded bg-gray-100 dark:bg-gray-800/80" />
|
||||
<div className="h-4 w-5/6 animate-pulse rounded bg-gray-100 dark:bg-gray-800/80" />
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<Footer />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (!city) {
|
||||
return (
|
||||
@@ -181,6 +305,11 @@ export default function CityGuidePage({ params }: { params: Promise<{ slug: stri
|
||||
</div>
|
||||
|
||||
<div className="p-6 sm:p-8">
|
||||
{apiError && (
|
||||
<p className="mb-4 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-800 dark:border-amber-900/50 dark:bg-amber-950/30 dark:text-amber-200">
|
||||
城市数据暂时无法同步,当前展示本地指南内容。
|
||||
</p>
|
||||
)}
|
||||
<p className="text-gray-600 dark:text-gray-400 text-base sm:text-lg mb-8">
|
||||
{city.descriptionZh}
|
||||
</p>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import { Link, useTranslation } from "@/i18n/navigation";
|
||||
import CityCard from "@/app/components/CityCard";
|
||||
import CityModal from "@/app/components/CityModal";
|
||||
@@ -110,21 +110,28 @@ export default function DashboardPage() {
|
||||
.catch(() => setRoutes([]));
|
||||
}, []);
|
||||
|
||||
const fallbackRecommendations = useMemo(() => {
|
||||
return [...baseCities]
|
||||
.filter((city) => city.costPerMonth <= budget * 1.25 && city.internetSpeed >= internet * 0.8)
|
||||
.map((city) => ({
|
||||
...city,
|
||||
matchScore: Math.round(city.overallScore * 20 + Math.max(0, 20 - city.costPerMonth / 500)),
|
||||
matchReasons: [
|
||||
city.costPerMonth <= budget ? "预算内" : "略超预算",
|
||||
city.internetSpeed >= internet ? "网络达标" : "需确认住处网络",
|
||||
city.nomadsNow >= 300 ? "社区活跃" : "适合安静工作",
|
||||
],
|
||||
}))
|
||||
.sort((a, b) => (b.matchScore || 0) - (a.matchScore || 0))
|
||||
.slice(0, 12);
|
||||
}, [baseCities, budget, internet]);
|
||||
const buildFallbackRecommendations = useCallback(
|
||||
(cities: RecommendedCity[]) =>
|
||||
[...cities]
|
||||
.filter((city) => city.costPerMonth <= budget * 1.25 && city.internetSpeed >= internet * 0.8)
|
||||
.map((city) => ({
|
||||
...city,
|
||||
matchScore: Math.round(city.overallScore * 20 + Math.max(0, 20 - city.costPerMonth / 500)),
|
||||
matchReasons: [
|
||||
city.costPerMonth <= budget ? "预算内" : "略超预算",
|
||||
city.internetSpeed >= internet ? "网络达标" : "需确认住处网络",
|
||||
city.nomadsNow >= 300 ? "社区活跃" : "适合安静工作",
|
||||
],
|
||||
}))
|
||||
.sort((a, b) => (b.matchScore || 0) - (a.matchScore || 0))
|
||||
.slice(0, 12),
|
||||
[budget, internet]
|
||||
);
|
||||
|
||||
const fallbackRecommendations = useMemo(
|
||||
() => buildFallbackRecommendations(baseCities),
|
||||
[baseCities, buildFallbackRecommendations]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
let cancelled = false;
|
||||
@@ -138,12 +145,14 @@ export default function DashboardPage() {
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
if (!cancelled) setRecommendedCities(fallbackRecommendations);
|
||||
if (!cancelled) {
|
||||
setRecommendedCities(buildFallbackRecommendations(baseCities));
|
||||
}
|
||||
});
|
||||
return () => {
|
||||
cancelled = true;
|
||||
};
|
||||
}, [budget, climate, fallbackRecommendations, internet, selectedTags]);
|
||||
}, [baseCities, budget, buildFallbackRecommendations, climate, internet, selectedTags]);
|
||||
|
||||
const displayCities = recommendedCities.length ? recommendedCities : fallbackRecommendations;
|
||||
const bestCity = displayCities[0];
|
||||
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
redirectToPay,
|
||||
getDeviceFromEnv,
|
||||
} from "@/app/digital/lib/payment";
|
||||
import type { PayEnv } from "@/app/digital/lib/payment";
|
||||
import { getStoredToken } from "@/app/digital/lib/pocketbase";
|
||||
import AuthModal from "@/app/digital/components/AuthModal";
|
||||
|
||||
@@ -53,7 +52,6 @@ export default function JoinPage() {
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [payRedirecting, setPayRedirecting] = useState(false);
|
||||
const [payEnv, setPayEnv] = useState<PayEnv | null>(null);
|
||||
const [authOpen, setAuthOpen] = useState(false);
|
||||
|
||||
const checkAuth = useCallback(async () => {
|
||||
@@ -73,12 +71,6 @@ export default function JoinPage() {
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (typeof window === "undefined") return;
|
||||
const env = getPayEnv();
|
||||
setPayEnv(env);
|
||||
}, []);
|
||||
|
||||
const set = (key: keyof FormData, value: string) =>
|
||||
setForm((prev) => ({ ...prev, [key]: value }));
|
||||
|
||||
|
||||
@@ -8,9 +8,8 @@ import {
|
||||
getDeviceFromEnv,
|
||||
} from "@/app/lib/payment";
|
||||
import { usePayStatusPoll } from "@/app/lib/payment/usePayStatusPoll";
|
||||
import type { PayEnv } from "@/app/lib/payment";
|
||||
import AuthModal from "@/app/components/AuthModal";
|
||||
import { apiUrl } from "@/app/lib/api-client";
|
||||
import { apiFetch, fetchAuthMe } from "@/app/lib/api-client";
|
||||
|
||||
const genderOptions = ["男", "女"];
|
||||
const singleOptions = ["单身", "恋爱中", "已婚"];
|
||||
@@ -55,7 +54,6 @@ export default function JoinPage() {
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [payRedirecting, setPayRedirecting] = useState(false);
|
||||
const [payEnv, setPayEnv] = useState<PayEnv | null>(null);
|
||||
const [authOpen, setAuthOpen] = useState(false);
|
||||
const [pendingSubmit, setPendingSubmit] = useState(false);
|
||||
const [isAlreadyRecorded, setIsAlreadyRecorded] = useState(false);
|
||||
@@ -67,14 +65,13 @@ export default function JoinPage() {
|
||||
}
|
||||
const checkExisting = async () => {
|
||||
try {
|
||||
const meRes = await fetch(apiUrl("/api/auth/me"), { credentials: "include" });
|
||||
const meData = await meRes.json().catch(() => ({}));
|
||||
if (!meRes.ok || !meData?.user) {
|
||||
return;
|
||||
}
|
||||
const statusRes = await fetch(apiUrl("/api/join/status"), { credentials: "include", cache: "no-store" });
|
||||
const statusData = await statusRes.json().catch(() => ({}));
|
||||
if (statusRes.ok && statusData?.hasRecord && statusData?.isComplete) {
|
||||
const meData = await fetchAuthMe();
|
||||
if (!meData?.user) return;
|
||||
const statusData = await apiFetch<{ hasRecord?: boolean; isComplete?: boolean }>(
|
||||
"/api/join/status",
|
||||
{ cache: "no-store" }
|
||||
);
|
||||
if (statusData?.hasRecord && statusData?.isComplete) {
|
||||
setIsAlreadyRecorded(true);
|
||||
setSubmitted(true);
|
||||
}
|
||||
@@ -94,11 +91,6 @@ export default function JoinPage() {
|
||||
window.location.replace(url);
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (typeof window === "undefined") return;
|
||||
setPayEnv(getPayEnv());
|
||||
}, []);
|
||||
|
||||
const set = (key: keyof FormData, value: string) =>
|
||||
setForm((prev) => ({ ...prev, [key]: value }));
|
||||
|
||||
@@ -106,14 +98,11 @@ export default function JoinPage() {
|
||||
setError(null);
|
||||
setSubmitting(true);
|
||||
try {
|
||||
const res = await fetch(apiUrl("/api/join"), {
|
||||
const data = await apiFetch<{ ok?: boolean; user_id?: string; error?: string }>("/api/join", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ ...form, media: media?.url }),
|
||||
credentials: "include",
|
||||
});
|
||||
const data = await res.json();
|
||||
if (!res.ok || !data?.ok) {
|
||||
if (!data?.ok) {
|
||||
throw new Error(data?.error || "提交失败,请稍后重试");
|
||||
}
|
||||
const userId = data.user_id;
|
||||
@@ -122,8 +111,7 @@ export default function JoinPage() {
|
||||
return;
|
||||
}
|
||||
// 再次确认 VIP,防止 handleAuthSuccess 等路径绕过
|
||||
const vipRes2 = await fetch(apiUrl("/api/vip/check"), { credentials: "include", cache: "no-store" });
|
||||
const vipData2 = await vipRes2.json();
|
||||
const vipData2 = await apiFetch<{ vip?: boolean }>("/api/vip/check", { cache: "no-store" });
|
||||
if (vipData2?.vip) {
|
||||
setIsVipSubmit(true);
|
||||
setSubmitted(true);
|
||||
@@ -153,15 +141,13 @@ export default function JoinPage() {
|
||||
|
||||
const handleSubmit = async (e: FormEvent) => {
|
||||
e.preventDefault();
|
||||
const meRes = await fetch(apiUrl("/api/auth/me"), { credentials: "include" });
|
||||
const meData = await meRes.json();
|
||||
const meData = await fetchAuthMe();
|
||||
if (!meData?.user) {
|
||||
setPendingSubmit(true);
|
||||
setAuthOpen(true);
|
||||
return;
|
||||
}
|
||||
const vipRes = await fetch(apiUrl("/api/vip/check"), { credentials: "include", cache: "no-store" });
|
||||
const vipData = await vipRes.json();
|
||||
const vipData = await apiFetch<{ vip?: boolean }>("/api/vip/check", { cache: "no-store" });
|
||||
if (vipData?.vip) {
|
||||
setIsVipSubmit(true);
|
||||
}
|
||||
@@ -394,12 +380,11 @@ export default function JoinPage() {
|
||||
try {
|
||||
const fd = new FormData();
|
||||
fd.append("file", file);
|
||||
const res = await fetch(apiUrl("/api/upload-media"), {
|
||||
method: "POST",
|
||||
body: fd,
|
||||
});
|
||||
const data = await res.json();
|
||||
if (!res.ok || !data?.ok) {
|
||||
const data = await apiFetch<{ ok?: boolean; url?: string; error?: string }>(
|
||||
"/api/upload-media",
|
||||
{ method: "POST", body: fd }
|
||||
);
|
||||
if (!data?.ok) {
|
||||
throw new Error(data?.error || "上传失败");
|
||||
}
|
||||
setMedia((m) => (m ? { ...m, url: data.url } : null));
|
||||
|
||||
@@ -739,18 +739,37 @@ export default function MeetupsPage() {
|
||||
const c = getCopy(locale);
|
||||
const [activeTab, setActiveTab] = useState<"upcoming" | "previous">("upcoming");
|
||||
const [modeFilter, setModeFilter] = useState<ModeFilter>("all");
|
||||
const [meetups, setMeetups] = useState<Meetup[]>(allMeetups);
|
||||
const [meetups, setMeetups] = useState<Meetup[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [loadError, setLoadError] = useState(false);
|
||||
const [selectedMeetup, setSelectedMeetup] = useState<Meetup | null>(null);
|
||||
const [viewer, setViewer] = useState<ViewerState>({ loaded: false, user: null, vip: false });
|
||||
|
||||
useEffect(() => {
|
||||
let cancelled = false;
|
||||
apiFetch<{ items: Array<Partial<Meetup> & { id: string; status?: string }> }>("/api/meetups")
|
||||
.then((data) => {
|
||||
if (cancelled) return;
|
||||
if (data.items?.length) {
|
||||
setMeetups(data.items.map(mapMeetup));
|
||||
setLoadError(false);
|
||||
} else {
|
||||
setMeetups(allMeetups);
|
||||
setLoadError(true);
|
||||
}
|
||||
})
|
||||
.catch(() => setMeetups(allMeetups));
|
||||
.catch(() => {
|
||||
if (!cancelled) {
|
||||
setMeetups(allMeetups);
|
||||
setLoadError(true);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
if (!cancelled) setLoading(false);
|
||||
});
|
||||
return () => {
|
||||
cancelled = true;
|
||||
};
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -865,13 +884,33 @@ export default function MeetupsPage() {
|
||||
{activeTab === "upcoming" ? c.upcomingCountSuffix : c.previousCountSuffix}
|
||||
</p>
|
||||
|
||||
{loadError && !loading && (
|
||||
<p className="mb-4 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-800 dark:border-amber-900/50 dark:bg-amber-950/30 dark:text-amber-200">
|
||||
{locale === "zh" ? "活动数据暂时无法同步,当前展示示例活动。" : "Unable to sync meetups; showing sample events."}
|
||||
</p>
|
||||
)}
|
||||
|
||||
<div className="grid grid-cols-1 gap-5 sm:grid-cols-2 sm:gap-6 lg:grid-cols-3">
|
||||
{displayedMeetups.map((meetup) => (
|
||||
<MeetupCard key={meetup.id} meetup={meetup} locale={locale} viewer={viewer} onSelect={setSelectedMeetup} />
|
||||
))}
|
||||
{loading
|
||||
? Array.from({ length: 6 }).map((_, index) => (
|
||||
<div
|
||||
key={`skeleton-${index}`}
|
||||
className="h-[360px] animate-pulse overflow-hidden rounded-2xl bg-white shadow-sm dark:bg-gray-900"
|
||||
>
|
||||
<div className="h-28 bg-gray-200 dark:bg-gray-800" />
|
||||
<div className="space-y-3 p-5">
|
||||
<div className="h-6 w-2/3 rounded bg-gray-200 dark:bg-gray-800" />
|
||||
<div className="h-4 w-full rounded bg-gray-100 dark:bg-gray-800/80" />
|
||||
<div className="h-4 w-5/6 rounded bg-gray-100 dark:bg-gray-800/80" />
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
: displayedMeetups.map((meetup) => (
|
||||
<MeetupCard key={meetup.id} meetup={meetup} locale={locale} viewer={viewer} onSelect={setSelectedMeetup} />
|
||||
))}
|
||||
</div>
|
||||
|
||||
{displayedMeetups.length === 0 && (
|
||||
{!loading && displayedMeetups.length === 0 && (
|
||||
<div className="py-16 text-center sm:py-24">
|
||||
<span className="mb-4 block text-5xl sm:text-6xl">🍹</span>
|
||||
<p className="text-base text-gray-500 dark:text-gray-400 sm:text-lg">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState, useMemo } from "react";
|
||||
import { useEffect, useState, useMemo, type CSSProperties } from "react";
|
||||
import { Link, useLocale } from "@/i18n/navigation";
|
||||
import { useTranslation } from "@/i18n/navigation";
|
||||
import HeroSection from "../components/HeroSection";
|
||||
@@ -289,6 +289,7 @@ export default function Home() {
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
const rowStyle = { "--right-row": index + 1 } as CSSProperties;
|
||||
return isExternal ? (
|
||||
<a
|
||||
key={item.slug}
|
||||
@@ -296,7 +297,7 @@ export default function Home() {
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="right-item block"
|
||||
style={{ gridColumn: "-2 / -1", gridRow: index + 1 }}
|
||||
style={rowStyle}
|
||||
>
|
||||
{content}
|
||||
</a>
|
||||
@@ -305,14 +306,14 @@ export default function Home() {
|
||||
key={item.slug}
|
||||
href={meta.href}
|
||||
className="right-item block"
|
||||
style={{ gridColumn: "-2 / -1", gridRow: index + 1 }}
|
||||
style={rowStyle}
|
||||
>
|
||||
{content}
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
|
||||
<Link href="/join" className="right-item block" style={{ gridColumn: "-2 / -1", gridRow: homepageFeatureContent.length + 1 }}>
|
||||
<Link href="/join" className="right-item block" style={{ "--right-row": homepageFeatureContent.length + 1 } as React.CSSProperties}>
|
||||
<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>
|
||||
@@ -328,12 +329,12 @@ export default function Home() {
|
||||
</div>
|
||||
</Link>
|
||||
|
||||
<Link href="/dating" className="right-item block" style={{ gridColumn: "-2 / -1", gridRow: homepageFeatureContent.length + 2 }}>
|
||||
<Link href="/dating" className="right-item block" style={{ "--right-row": homepageFeatureContent.length + 2 } as React.CSSProperties}>
|
||||
<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) => (
|
||||
{memberPhotos.map((m, i) => (
|
||||
<img
|
||||
key={m.name}
|
||||
key={`${m.name}-${i}`}
|
||||
src={mediaUrl(m.photo)}
|
||||
alt={m.name}
|
||||
title={m.name}
|
||||
@@ -346,7 +347,7 @@ export default function Home() {
|
||||
</div>
|
||||
</Link>
|
||||
|
||||
<Link href="/meetups" className="right-item block" style={{ gridColumn: "-2 / -1", gridRow: homepageFeatureContent.length + 3 }}>
|
||||
<Link href="/meetups" className="right-item block" style={{ "--right-row": homepageFeatureContent.length + 3 } as React.CSSProperties}>
|
||||
<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)]">
|
||||
{homeMeetups.slice(0, 3).map((meetup) => (
|
||||
@@ -359,9 +360,9 @@ export default function Home() {
|
||||
</div>
|
||||
))}
|
||||
<div className="flex -space-x-1 mt-auto">
|
||||
{memberPhotos.slice(0, 5).map((m) => (
|
||||
{memberPhotos.slice(0, 5).map((m, i) => (
|
||||
<img
|
||||
key={m.name}
|
||||
key={`${m.name}-meetup-${i}`}
|
||||
src={mediaUrl(m.photo)}
|
||||
alt=""
|
||||
className="w-4 h-4 sm:w-7 sm:h-7 rounded-full border-2 border-white dark:border-gray-800 shadow-sm object-cover"
|
||||
|
||||
Reference in New Issue
Block a user