feat: check-in scanner and fix bugs
All checks were successful
Backend Check Build (NixCN CMS) TeamCity build finished
Client CMS Check Build (NixCN CMS) TeamCity build finished

Signed-off-by: Noa Virellia <noa@requiem.garden>
This commit is contained in:
2026-02-11 21:56:04 +08:00
parent 1a5deabadb
commit 25a2bf75c5
9 changed files with 118 additions and 5 deletions

View File

@@ -19,7 +19,7 @@ const meta = {
export default meta;
type Story = StoryObj<typeof meta>;
export const Prompt: Story = {
export const Primary: Story = {
args: {
checkinCode: '114514',
},

View File

@@ -0,0 +1,27 @@
import type { Meta, StoryObj } from '@storybook/react-vite';
import { CheckinScannerDialogView } from '@/components/checkin/checkin-scanner.dialog.view';
import { Dialog } from '@/components/ui/dialog';
const meta = {
title: 'Events/CheckinScannerDialog',
component: CheckinScannerDialogView,
decorators: [
Story => (
<Dialog open={true}>
<Story />
</Dialog>
),
],
} satisfies Meta<typeof CheckinScannerDialogView>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Primary: Story = {
args: {
onScan: (value) => {
// eslint-disable-next-line no-console
console.log('Scanned value:', value);
},
},
};

View File

@@ -32,6 +32,7 @@ export const Loading: Story = {
description: '',
startTime: new Date(0),
endTime: new Date(0),
isCheckedIn: false,
},
actionFooter: <Button className="w-full"></Button>,
},

View File

@@ -1,7 +1,6 @@
import type { Meta, StoryObj } from '@storybook/react-vite';
import { EventGridSkeleton } from '@/components/events/event-grid/event-grid.skeleton';
import { EventGridView } from '@/components/events/event-grid/event-grid.view';
import { JoinedEventGridFooter } from '@/components/events/joined-events.containers';
import { Button } from '@/components/ui/button';
import { Skeleton as UiSkeleton } from '@/components/ui/skeleton';
import { exampleMultiEvents } from './event.example';
@@ -24,7 +23,12 @@ export const Primary: Story = {
export const Joined: Story = {
args: {
events: exampleMultiEvents,
footer: event => <JoinedEventGridFooter event={event} />,
footer: () => (
<div className="flex flex-row justify-between w-full gap-4">
<Button className="flex-1"></Button>
<Button className="flex-1"></Button>
</div>
),
},
};

View File

@@ -10,6 +10,7 @@ export const exampleEvent: EventInfo = {
description: 'Event Description',
startTime: new Date('2026-06-13T04:00:00.000Z'),
endTime: new Date('2026-06-14T04:00:00.000Z'),
isCheckedIn: false,
};
export const exampleMultiEvents: EventInfo[] = [
@@ -23,6 +24,7 @@ export const exampleMultiEvents: EventInfo[] = [
description: 'Event Description',
startTime: new Date('2026-06-13T04:00:00.000Z'),
endTime: new Date('2026-06-14T04:00:00.000Z'),
isCheckedIn: false,
},
{
eventId: '2',
@@ -34,6 +36,7 @@ export const exampleMultiEvents: EventInfo[] = [
description: 'Event Description',
startTime: new Date('2026-06-13T04:00:00.000Z'),
endTime: new Date('2026-06-14T04:00:00.000Z'),
isCheckedIn: false,
},
{
eventId: '3',
@@ -45,6 +48,7 @@ export const exampleMultiEvents: EventInfo[] = [
description: 'Event Description',
startTime: new Date('2026-06-13T04:00:00.000Z'),
endTime: new Date('2026-06-14T04:00:00.000Z'),
isCheckedIn: false,
},
{
eventId: '4',
@@ -56,5 +60,6 @@ export const exampleMultiEvents: EventInfo[] = [
description: 'Event Description',
startTime: new Date('2026-06-13T04:00:00.000Z'),
endTime: new Date('2026-06-14T04:00:00.000Z'),
isCheckedIn: false,
},
];