feat(client): joined event list
Some checks failed
Backend Check Build (NixCN CMS) TeamCity build failed
Client CMS Check Build (NixCN CMS) TeamCity build finished

Signed-off-by: Noa Virellia <noa@requiem.garden>
This commit is contained in:
2026-02-08 14:50:34 +08:00
parent bd23a53fbb
commit fc29d62a00
15 changed files with 262 additions and 70 deletions

View File

@@ -1,10 +1,9 @@
import type { EventInfo } from '../types';
import PlaceholderImage from '@/assets/event-placeholder.png';
import { useGetEvents } from '@/hooks/data/useGetEvents';
import { useEvents } from '@/hooks/data/useEvents';
import { Button } from '../../ui/button';
import { DialogTrigger } from '../../ui/dialog';
import { EventJoinDialogContainer } from '../event-join.dialog.container';
import { KycDialogContainer } from '../kyc/kyc.dialog.container';
import { toEventInfo } from '../types';
import { EventGridSkeleton } from './event-grid.skeleton';
import { EventGridView } from './event-grid.view';
@@ -15,24 +14,14 @@ function JoinButton() {
}
export function EventGridContainer() {
const { data, isLoading } = useGetEvents();
const { data, isLoading } = useEvents();
return (
isLoading
? <EventGridSkeleton />
: (
<EventGridView
events={data.pages.flatMap(page => page.data ?? []).map(it => ({
type: it.type! as EventInfo['type'],
eventId: it.event_id!,
isJoined: it.is_joined!,
requireKyc: it.enable_kyc!,
coverImage: it.thumbnail! || PlaceholderImage,
eventName: it.name!,
description: it.description!,
startTime: new Date(it.start_time!),
endTime: new Date(it.end_time!),
} satisfies EventInfo))}
events={data.pages.flatMap(page => page.data ?? []).map(toEventInfo)}
footer={eventInfo => (eventInfo.isJoined
? <Button className="w-full" disabled></Button>
: (