's'
This commit is contained in:
@@ -99,6 +99,7 @@ export default function HostMeetupPage() {
|
||||
const locale = useLocale();
|
||||
const c = getCopy(locale);
|
||||
const [submitted, setSubmitted] = useState(false);
|
||||
const [submitError, setSubmitError] = useState<string | null>(null);
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
const [form, setForm] = useState<HostMeetupForm>({
|
||||
mode: "offline",
|
||||
@@ -152,10 +153,12 @@ export default function HostMeetupPage() {
|
||||
const handleSubmit = async (e: FormEvent) => {
|
||||
e.preventDefault();
|
||||
setSubmitting(true);
|
||||
setSubmitError(null);
|
||||
try {
|
||||
const finalCity = isOnlineOnly && !form.city ? "线上" : form.city;
|
||||
const finalVenue = isOnlineOnly && !form.venue ? "MiroTalk 多人视频房" : form.venue;
|
||||
const finalAddress = isOnlineOnly && !form.address ? "线上活动" : form.address;
|
||||
const customRoom = normalizeMiroTalkRoom(form.mirotalkRoom);
|
||||
await apiFetch("/api/meetups", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
@@ -166,7 +169,6 @@ export default function HostMeetupPage() {
|
||||
venue: finalVenue,
|
||||
address: finalAddress,
|
||||
description: form.description,
|
||||
rsvpCount: 1,
|
||||
gradientFrom: city?.gradientFrom || (isOnlineMode ? "#0f766e" : "#ff4d4f"),
|
||||
gradientTo: city?.gradientTo || (isOnlineMode ? "#2563eb" : "#ff7a45"),
|
||||
attendees: [],
|
||||
@@ -177,13 +179,21 @@ export default function HostMeetupPage() {
|
||||
organizer: form.organizer.trim() || "NomadCNA",
|
||||
accessLevel: form.accessLevel,
|
||||
meetingProvider: isOnlineMode ? form.meetingProvider : "",
|
||||
mirotalkRoom: isOnlineMode ? roomToUse : "",
|
||||
mirotalkRoom: isOnlineMode && customRoom ? customRoom : "",
|
||||
meetingUrl: isOnlineMode ? form.meetingUrl.trim() : "",
|
||||
replayUrl: "",
|
||||
features: isOnlineMode ? form.features : [],
|
||||
}),
|
||||
});
|
||||
setSubmitted(true);
|
||||
} catch (err) {
|
||||
setSubmitError(
|
||||
err instanceof Error
|
||||
? err.message
|
||||
: locale === "zh"
|
||||
? "提交失败,请稍后重试"
|
||||
: "Submission failed, please try again"
|
||||
);
|
||||
} finally {
|
||||
setSubmitting(false);
|
||||
}
|
||||
@@ -479,6 +489,12 @@ export default function HostMeetupPage() {
|
||||
{c.pendingHint}
|
||||
</p>
|
||||
|
||||
{submitError && (
|
||||
<p className="rounded-lg border border-red-100 bg-red-50 px-4 py-3 text-sm text-red-700 dark:border-red-900/50 dark:bg-red-950/40 dark:text-red-300">
|
||||
{submitError}
|
||||
</p>
|
||||
)}
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
disabled={submitting}
|
||||
|
||||
@@ -22,10 +22,33 @@ import {
|
||||
} from "@/app/lib/meetups";
|
||||
import { mediaUrl } from "@/app/lib/media";
|
||||
import { avatarForIndex } from "@/app/data/avatars";
|
||||
import { cancelMeetupRsvp, fetchMeetupRsvpStatus, rsvpMeetup } from "@/app/lib/social";
|
||||
import MeetupSocialPanel from "@/app/components/meetups/MeetupSocialPanel";
|
||||
|
||||
function AttendeeAvatar({ attendee, className }: { attendee: Attendee; className?: string }) {
|
||||
const image = (
|
||||
<img
|
||||
src={mediaUrl(attendee.photo)}
|
||||
alt={attendee.name}
|
||||
title={attendee.name}
|
||||
className={className || "h-8 w-8 rounded-full border border-white object-cover shadow-sm dark:border-gray-800"}
|
||||
/>
|
||||
);
|
||||
if (attendee.profileId) {
|
||||
return (
|
||||
<Link href={`/members/${attendee.profileId}`} className="transition hover:scale-105">
|
||||
{image}
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
return image;
|
||||
}
|
||||
|
||||
interface Attendee {
|
||||
name: string;
|
||||
photo: string;
|
||||
profileId?: string;
|
||||
userId?: string;
|
||||
}
|
||||
|
||||
interface Meetup {
|
||||
@@ -467,6 +490,15 @@ function toAccessLevel(value: unknown): MeetupAccessLevel {
|
||||
return value === "members" || value === "vip" || value === "hosts" || value === "public" ? value : "public";
|
||||
}
|
||||
|
||||
function computeIsUpcoming(item: { date?: string; time?: string; isUpcoming?: boolean }): boolean {
|
||||
const datePart = String(item.date || "").slice(0, 10);
|
||||
if (!datePart) return Boolean(item.isUpcoming ?? true);
|
||||
const timePart = String(item.time || "23:59").slice(0, 5);
|
||||
const eventAt = new Date(`${datePart}T${timePart}:00`);
|
||||
if (Number.isNaN(eventAt.getTime())) return Boolean(item.isUpcoming ?? true);
|
||||
return eventAt.getTime() > Date.now();
|
||||
}
|
||||
|
||||
function mapMeetup(item: Partial<Meetup> & { id: string; status?: string }): Meetup {
|
||||
const mode = toMeetupMode(item.mode || (item.meetingUrl || item.mirotalkRoom ? "online" : "offline"));
|
||||
return {
|
||||
@@ -482,7 +514,7 @@ function mapMeetup(item: Partial<Meetup> & { id: string; status?: string }): Mee
|
||||
gradientFrom: item.gradientFrom || (mode === "online" ? "#0f766e" : "#ff4d4f"),
|
||||
gradientTo: item.gradientTo || (mode === "online" ? "#2563eb" : "#ff7a45"),
|
||||
attendees: Array.isArray(item.attendees) ? item.attendees : [],
|
||||
isUpcoming: Boolean(item.isUpcoming ?? true),
|
||||
isUpcoming: computeIsUpcoming(item),
|
||||
mode,
|
||||
accessLevel: toAccessLevel(item.accessLevel),
|
||||
meetingProvider: item.meetingProvider || (mode === "offline" ? "" : "mirotalk"),
|
||||
@@ -588,7 +620,11 @@ function MeetupCard({ meetup, locale, viewer, onSelect }: { meetup: Meetup; loca
|
||||
<div className="mt-auto flex items-center gap-1 border-t border-gray-100 pt-4 dark:border-gray-700">
|
||||
<div className="flex -space-x-2">
|
||||
{meetup.attendees.map((a, index) => (
|
||||
<img key={`${a.name}-${index}`} src={mediaUrl(a.photo)} alt={a.name} className="h-7 w-7 rounded-full border-2 border-white object-cover shadow-sm dark:border-gray-800 sm:h-8 sm:w-8" title={a.name} />
|
||||
<AttendeeAvatar
|
||||
key={`${a.name}-${index}`}
|
||||
attendee={a}
|
||||
className="h-7 w-7 rounded-full border-2 border-white object-cover shadow-sm dark:border-gray-800 sm:h-8 sm:w-8"
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
<span className="ml-1 text-xs text-gray-400 dark:text-gray-500">{locale === "zh" ? "已报名成员" : "attendees"}</span>
|
||||
@@ -598,17 +634,66 @@ function MeetupCard({ meetup, locale, viewer, onSelect }: { meetup: Meetup; loca
|
||||
);
|
||||
}
|
||||
|
||||
function MeetupDetailModal({ meetup, locale, viewer, onClose }: { meetup: Meetup; locale: string; viewer: ViewerState; onClose: () => void }) {
|
||||
function MeetupDetailModal({
|
||||
meetup,
|
||||
locale,
|
||||
viewer,
|
||||
onClose,
|
||||
onMeetupUpdated,
|
||||
}: {
|
||||
meetup: Meetup;
|
||||
locale: string;
|
||||
viewer: ViewerState;
|
||||
onClose: () => void;
|
||||
onMeetupUpdated?: (meetup: Meetup) => void;
|
||||
}) {
|
||||
const c = getCopy(locale);
|
||||
const [embedOpen, setEmbedOpen] = useState(false);
|
||||
const canJoin = canAccessMeetup(meetup, viewer);
|
||||
const joinUrl = buildMiroTalkJoinUrl(meetup, viewerDisplayName(viewer));
|
||||
const chatUrl = buildMeetupChatUrl(meetup);
|
||||
const livePath = buildMeetupLivePath(meetup.id);
|
||||
const [rsvped, setRsvped] = useState(false);
|
||||
const [rsvpLoading, setRsvpLoading] = useState(false);
|
||||
const [localMeetup, setLocalMeetup] = useState(meetup);
|
||||
|
||||
useEffect(() => {
|
||||
setLocalMeetup(meetup);
|
||||
}, [meetup]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!viewer.user?.id) {
|
||||
setRsvped(false);
|
||||
return;
|
||||
}
|
||||
fetchMeetupRsvpStatus(meetup.id).then(setRsvped);
|
||||
}, [meetup.id, viewer.user?.id]);
|
||||
const canJoin = canAccessMeetup(localMeetup, viewer);
|
||||
const joinUrl = buildMiroTalkJoinUrl(localMeetup, viewerDisplayName(viewer));
|
||||
const chatUrl = buildMeetupChatUrl(localMeetup);
|
||||
const livePath = buildMeetupLivePath(localMeetup.id);
|
||||
|
||||
const applyMeetupUpdate = (raw: Record<string, unknown>) => {
|
||||
const next = mapMeetup({ ...raw, id: String(raw.id || localMeetup.id) } as Partial<Meetup> & { id: string });
|
||||
setLocalMeetup(next);
|
||||
onMeetupUpdated?.(next);
|
||||
};
|
||||
|
||||
const handleRsvp = async () => {
|
||||
if (!viewer.user?.id) return;
|
||||
setRsvpLoading(true);
|
||||
try {
|
||||
if (rsvped) {
|
||||
const data = await cancelMeetupRsvp(localMeetup.id);
|
||||
setRsvped(false);
|
||||
if (data.meetup) applyMeetupUpdate(data.meetup);
|
||||
} else {
|
||||
const data = await rsvpMeetup(localMeetup.id);
|
||||
setRsvped(true);
|
||||
if (data.meetup) applyMeetupUpdate(data.meetup);
|
||||
}
|
||||
} finally {
|
||||
setRsvpLoading(false);
|
||||
}
|
||||
};
|
||||
const mirotalkServer = getMiroTalkServerLabel();
|
||||
const loungeServer = getLoungeServerLabel();
|
||||
const isVideoEvent = isLiveMeetup(meetup);
|
||||
|
||||
return (
|
||||
<div className="fixed inset-0 z-[9999] overflow-y-auto">
|
||||
<button type="button" className="fixed inset-0 cursor-default bg-black/55 backdrop-blur-sm" onClick={onClose} aria-label={locale === "zh" ? "关闭活动详情" : "Close event details"} />
|
||||
@@ -626,12 +711,12 @@ function MeetupDetailModal({ meetup, locale, viewer, onClose }: { meetup: Meetup
|
||||
</svg>
|
||||
</button>
|
||||
<div className="flex flex-wrap gap-2 pr-12">
|
||||
<span className="rounded-full bg-white/18 px-2.5 py-1 text-xs font-semibold backdrop-blur">{modeLabel(meetup.mode, locale)}</span>
|
||||
<span className="rounded-full bg-white/18 px-2.5 py-1 text-xs font-semibold backdrop-blur">{accessLabel(meetup.accessLevel, locale)}</span>
|
||||
{meetup.meetingProvider === "mirotalk" && <span className="rounded-full bg-white/18 px-2.5 py-1 text-xs font-semibold backdrop-blur">{MIROTALK_PROVIDER_LABEL}</span>}
|
||||
<span className="rounded-full bg-white/18 px-2.5 py-1 text-xs font-semibold backdrop-blur">{modeLabel(localMeetup.mode, locale)}</span>
|
||||
<span className="rounded-full bg-white/18 px-2.5 py-1 text-xs font-semibold backdrop-blur">{accessLabel(localMeetup.accessLevel, locale)}</span>
|
||||
{localMeetup.meetingProvider === "mirotalk" && <span className="rounded-full bg-white/18 px-2.5 py-1 text-xs font-semibold backdrop-blur">{MIROTALK_PROVIDER_LABEL}</span>}
|
||||
</div>
|
||||
<h2 className="mt-5 text-2xl font-bold sm:text-3xl">{meetup.emoji} {meetup.city} · {meetup.venue}</h2>
|
||||
<p className="mt-2 max-w-2xl text-sm leading-6 text-white/88">{meetup.description}</p>
|
||||
<h2 className="mt-5 text-2xl font-bold sm:text-3xl">{localMeetup.emoji} {localMeetup.city} · {localMeetup.venue}</h2>
|
||||
<p className="mt-2 max-w-2xl text-sm leading-6 text-white/88">{localMeetup.description}</p>
|
||||
</div>
|
||||
|
||||
<div className="grid gap-5 p-5 sm:p-7 lg:grid-cols-[1.1fr_0.9fr]">
|
||||
@@ -639,32 +724,32 @@ function MeetupDetailModal({ meetup, locale, viewer, onClose }: { meetup: Meetup
|
||||
<div className="grid gap-3 sm:grid-cols-2">
|
||||
<div className="rounded-xl border border-gray-100 bg-gray-50 p-4 dark:border-gray-800 dark:bg-gray-950">
|
||||
<p className="text-xs font-semibold uppercase tracking-wide text-gray-400">{locale === "zh" ? "时间" : "Time"}</p>
|
||||
<p className="mt-1 text-sm font-semibold text-gray-900 dark:text-gray-100">{formatMeetupDate(meetup.date, meetup.time)}</p>
|
||||
<p className="mt-1 text-sm font-semibold text-gray-900 dark:text-gray-100">{formatMeetupDate(localMeetup.date, localMeetup.time)}</p>
|
||||
</div>
|
||||
<div className="rounded-xl border border-gray-100 bg-gray-50 p-4 dark:border-gray-800 dark:bg-gray-950">
|
||||
<p className="text-xs font-semibold uppercase tracking-wide text-gray-400">{c.organizer}</p>
|
||||
<p className="mt-1 text-sm font-semibold text-gray-900 dark:text-gray-100">{meetup.organizer}</p>
|
||||
<p className="mt-1 text-sm font-semibold text-gray-900 dark:text-gray-100">{localMeetup.organizer}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="rounded-xl border border-gray-100 bg-gray-50 p-4 dark:border-gray-800 dark:bg-gray-950">
|
||||
<p className="text-xs font-semibold uppercase tracking-wide text-gray-400">{locale === "zh" ? "地点" : "Location"}</p>
|
||||
<p className="mt-1 text-sm font-semibold text-gray-900 dark:text-gray-100">{meetup.venue}</p>
|
||||
<p className="mt-1 text-sm text-gray-500 dark:text-gray-400">{meetup.address}</p>
|
||||
<p className="mt-1 text-sm font-semibold text-gray-900 dark:text-gray-100">{localMeetup.venue}</p>
|
||||
<p className="mt-1 text-sm text-gray-500 dark:text-gray-400">{localMeetup.address}</p>
|
||||
</div>
|
||||
|
||||
{isVideoEvent && (
|
||||
{isLiveMeetup(localMeetup) && (
|
||||
<div className="rounded-xl border border-emerald-100 bg-emerald-50/70 p-4 dark:border-emerald-900/50 dark:bg-emerald-950/30">
|
||||
<div className="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
|
||||
<div>
|
||||
<p className="text-xs font-semibold uppercase tracking-wide text-emerald-700 dark:text-emerald-300">{c.provider}</p>
|
||||
<p className="mt-1 text-sm font-semibold text-gray-900 dark:text-gray-100">{MIROTALK_PROVIDER_LABEL}</p>
|
||||
<p className="mt-1 break-all text-xs text-gray-500 dark:text-gray-400">{c.room}: {meetup.mirotalkRoom || meetup.id}</p>
|
||||
<p className="mt-1 break-all text-xs text-gray-500 dark:text-gray-400">{c.room}: {localMeetup.mirotalkRoom || localMeetup.id}</p>
|
||||
<p className="mt-1 break-all text-xs text-gray-500 dark:text-gray-400">{c.relayServer}: {mirotalkServer}</p>
|
||||
<p className="mt-2 text-xs font-semibold uppercase tracking-wide text-emerald-700 dark:text-emerald-300">{c.chatService}</p>
|
||||
<p className="mt-1 text-sm font-semibold text-gray-900 dark:text-gray-100">{WEB_CHAT_PROVIDER_LABEL}</p>
|
||||
<p className="mt-1 break-all text-xs text-gray-500 dark:text-gray-400">{c.chatServer}: {loungeServer}</p>
|
||||
<p className="mt-1 break-all text-xs text-gray-500 dark:text-gray-400">{c.chatChannel}: {meetup.loungeChannel || `#${meetup.mirotalkRoom || meetup.id}`}</p>
|
||||
<p className="mt-1 break-all text-xs text-gray-500 dark:text-gray-400">{c.chatChannel}: {localMeetup.loungeChannel || `#${localMeetup.mirotalkRoom || localMeetup.id}`}</p>
|
||||
</div>
|
||||
{canJoin ? (
|
||||
<div className="flex flex-wrap gap-2">
|
||||
@@ -699,18 +784,18 @@ function MeetupDetailModal({ meetup, locale, viewer, onClose }: { meetup: Meetup
|
||||
</button>
|
||||
</div>
|
||||
) : (
|
||||
<p className="rounded-lg border border-red-200 bg-white px-3 py-2 text-sm font-semibold text-red-600 dark:border-red-900/60 dark:bg-gray-900 dark:text-red-300">{lockedReason(meetup, locale)}</p>
|
||||
<p className="rounded-lg border border-red-200 bg-white px-3 py-2 text-sm font-semibold text-red-600 dark:border-red-900/60 dark:bg-gray-900 dark:text-red-300">{lockedReason(localMeetup, locale)}</p>
|
||||
)}
|
||||
</div>
|
||||
{canJoin && meetup.accessLevel === "public" && (
|
||||
{canJoin && localMeetup.accessLevel === "public" && (
|
||||
<p className="mt-3 text-xs text-emerald-700 dark:text-emerald-300">{c.authPublicHint}</p>
|
||||
)}
|
||||
{canJoin && (
|
||||
<p className="mt-2 text-xs text-emerald-700 dark:text-emerald-300">{c.chatHint}</p>
|
||||
)}
|
||||
{meetup.replayUrl ? (
|
||||
{localMeetup.replayUrl ? (
|
||||
<a
|
||||
href={meetup.replayUrl}
|
||||
href={localMeetup.replayUrl}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="mt-3 inline-flex text-sm font-semibold text-emerald-700 underline dark:text-emerald-300"
|
||||
@@ -720,7 +805,7 @@ function MeetupDetailModal({ meetup, locale, viewer, onClose }: { meetup: Meetup
|
||||
) : null}
|
||||
{embedOpen && canJoin && (
|
||||
<iframe
|
||||
title={`MiroTalk ${meetup.city}`}
|
||||
title={`MiroTalk ${localMeetup.city}`}
|
||||
src={joinUrl}
|
||||
className="mt-4 h-[360px] w-full rounded-xl border border-emerald-200 bg-black dark:border-emerald-900 sm:h-[460px]"
|
||||
allow="camera; microphone; display-capture; fullscreen; clipboard-read; clipboard-write"
|
||||
@@ -735,8 +820,8 @@ function MeetupDetailModal({ meetup, locale, viewer, onClose }: { meetup: Meetup
|
||||
<div className="rounded-xl border border-gray-100 p-4 dark:border-gray-800">
|
||||
<h3 className="text-sm font-bold text-gray-900 dark:text-gray-100">{c.featureTitle}</h3>
|
||||
<div className="mt-3 flex flex-wrap gap-2">
|
||||
{(featureLabels(meetup.features, locale).length ? featureLabels(meetup.features, locale) : [modeLabel(meetup.mode, locale)]).map((feature) => (
|
||||
<Badge key={feature} tone={meetup.mode === "offline" ? "gray" : "green"}>{feature}</Badge>
|
||||
{(featureLabels(localMeetup.features, locale).length ? featureLabels(localMeetup.features, locale) : [modeLabel(localMeetup.mode, locale)]).map((feature) => (
|
||||
<Badge key={feature} tone={localMeetup.mode === "offline" ? "gray" : "green"}>{feature}</Badge>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
@@ -754,13 +839,50 @@ function MeetupDetailModal({ meetup, locale, viewer, onClose }: { meetup: Meetup
|
||||
<div className="rounded-xl border border-gray-100 p-4 dark:border-gray-800">
|
||||
<div className="flex items-center justify-between gap-3">
|
||||
<span className="text-sm text-gray-500 dark:text-gray-400">{locale === "zh" ? "当前权限" : "Your access"}</span>
|
||||
<Badge tone={canJoin ? "green" : "red"}>{canJoin ? accessLabel(meetup.accessLevel, locale) : lockedReason(meetup, locale)}</Badge>
|
||||
<Badge tone={canJoin ? "green" : "red"}>{canJoin ? accessLabel(localMeetup.accessLevel, locale) : lockedReason(localMeetup, locale)}</Badge>
|
||||
</div>
|
||||
<div className="mt-3 flex items-center justify-between gap-3">
|
||||
<span className="text-sm text-gray-500 dark:text-gray-400">{locale === "zh" ? "报名人数" : "RSVPs"}</span>
|
||||
<span className="text-sm font-semibold text-gray-900 dark:text-gray-100">{meetup.rsvpCount}{meetup.maxAttendees ? ` / ${meetup.maxAttendees}` : ""}</span>
|
||||
<span className="text-sm font-semibold text-gray-900 dark:text-gray-100">{localMeetup.rsvpCount}{localMeetup.maxAttendees ? ` / ${localMeetup.maxAttendees}` : ""}</span>
|
||||
</div>
|
||||
{localMeetup.isUpcoming ? (
|
||||
<button
|
||||
type="button"
|
||||
onClick={handleRsvp}
|
||||
disabled={rsvpLoading || !viewer.user?.id}
|
||||
className={`mt-4 w-full rounded-xl px-4 py-3 text-sm font-semibold transition ${
|
||||
rsvped
|
||||
? "border border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-900 dark:bg-emerald-950/30 dark:text-emerald-300"
|
||||
: "bg-[#ff4d4f] text-white hover:bg-[#ff7a45]"
|
||||
} disabled:cursor-not-allowed disabled:opacity-60`}
|
||||
>
|
||||
{!viewer.user?.id
|
||||
? locale === "zh"
|
||||
? "登录后报名"
|
||||
: "Log in to RSVP"
|
||||
: rsvpLoading
|
||||
? locale === "zh"
|
||||
? "处理中..."
|
||||
: "Processing..."
|
||||
: rsvped
|
||||
? locale === "zh"
|
||||
? "已报名 · 取消"
|
||||
: "Going · Cancel"
|
||||
: locale === "zh"
|
||||
? "我要参加"
|
||||
: "RSVP"}
|
||||
</button>
|
||||
) : null}
|
||||
{localMeetup.attendees.length > 0 ? (
|
||||
<div className="mt-4 flex flex-wrap gap-2">
|
||||
{localMeetup.attendees.slice(0, 8).map((attendee, index) => (
|
||||
<AttendeeAvatar key={`${attendee.name}-${index}`} attendee={attendee} />
|
||||
))}
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
<MeetupSocialPanel meetupId={localMeetup.id} city={localMeetup.city} locale={locale} compact />
|
||||
</aside>
|
||||
</div>
|
||||
</section>
|
||||
@@ -959,7 +1081,17 @@ export default function MeetupsPage() {
|
||||
</main>
|
||||
|
||||
{selectedMeetup && (
|
||||
<MeetupDetailModal key={selectedMeetup.id} meetup={selectedMeetup} locale={locale} viewer={viewer} onClose={() => setSelectedMeetup(null)} />
|
||||
<MeetupDetailModal
|
||||
key={selectedMeetup.id}
|
||||
meetup={selectedMeetup}
|
||||
locale={locale}
|
||||
viewer={viewer}
|
||||
onClose={() => setSelectedMeetup(null)}
|
||||
onMeetupUpdated={(updated) => {
|
||||
setMeetups((current) => current.map((item) => (item.id === updated.id ? updated : item)));
|
||||
setSelectedMeetup(updated);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user