feat(events): add event join functionality with no kyc
Signed-off-by: Noa Virellia <noa@requiem.garden>
This commit is contained in:
@@ -2,6 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react-vite';
|
||||
import { EventCardSkeleton } from '@/components/events/event-card.skeleton';
|
||||
import { EventCardView } from '@/components/events/event-card.view';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { exampleEvent } from './event.example';
|
||||
|
||||
const meta = {
|
||||
title: 'Events/EventCard',
|
||||
@@ -13,17 +14,7 @@ type Story = StoryObj<typeof meta>;
|
||||
|
||||
export const Primary: Story = {
|
||||
args: {
|
||||
eventInfo: {
|
||||
eventId: '1',
|
||||
type: 'official',
|
||||
requireKyc: true,
|
||||
isJoined: false,
|
||||
coverImage: 'https://github.com/NixOS/nixos-artwork/blob/master/wallpapers/nix-wallpaper-watersplash.png?raw=true',
|
||||
eventName: 'Nix CN Conference 26.05',
|
||||
description: 'Event Description',
|
||||
startTime: new Date('2026-06-13T04:00:00.000Z'),
|
||||
endTime: new Date('2026-06-14T04:00:00.000Z'),
|
||||
},
|
||||
eventInfo: exampleEvent,
|
||||
actionFooter: <Button className="w-full">加入活动(示例)</Button>,
|
||||
},
|
||||
};
|
||||
|
||||
13
client/cms/src/stories/events/event.example.ts
Normal file
13
client/cms/src/stories/events/event.example.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { EventInfo } from '@/components/events/types';
|
||||
|
||||
export const exampleEvent: EventInfo = {
|
||||
eventId: '1',
|
||||
type: 'official',
|
||||
requireKyc: true,
|
||||
isJoined: false,
|
||||
coverImage: 'https://github.com/NixOS/nixos-artwork/blob/master/wallpapers/nix-wallpaper-watersplash.png?raw=true',
|
||||
eventName: 'Nix CN Conference 26.05',
|
||||
description: 'Event Description',
|
||||
startTime: new Date('2026-06-13T04:00:00.000Z'),
|
||||
endTime: new Date('2026-06-14T04:00:00.000Z'),
|
||||
};
|
||||
26
client/cms/src/stories/events/join-dialog.stories.tsx
Normal file
26
client/cms/src/stories/events/join-dialog.stories.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react-vite';
|
||||
import { EventJoinDialogView } from '@/components/events/event-join.dialog.view';
|
||||
import { Dialog } from '@/components/ui/dialog';
|
||||
import { exampleEvent } from './event.example';
|
||||
|
||||
const meta = {
|
||||
title: 'Events/JoinDialog',
|
||||
component: EventJoinDialogView,
|
||||
decorators: [
|
||||
Story => (
|
||||
<Dialog open={true}>
|
||||
<Story />
|
||||
</Dialog>
|
||||
),
|
||||
],
|
||||
} satisfies Meta<typeof EventJoinDialogView>;
|
||||
|
||||
export default meta;
|
||||
type Story = StoryObj<typeof meta>;
|
||||
|
||||
export const Confirm: Story = {
|
||||
args: {
|
||||
event: exampleEvent,
|
||||
onJoinEvent: () => { },
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user