-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate check-in action with Participants table (#341)
- When **Check In** action is used, show a modal with a confirmation - Make POST request to check-in endpoint upon confirmation - Several tasks still left as TODO - Need to add mutation for showing checked in on each day - Need to add actual instructions for check-in associates - Need to add Flashbar for notifications after modal completion - Will use a similar approach for the walk-in promotion modal
- Loading branch information
Showing
5 changed files
with
125 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
apps/site/src/app/admin/participants/components/CheckInModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import Box from "@cloudscape-design/components/box"; | ||
import Button from "@cloudscape-design/components/button"; | ||
import Modal from "@cloudscape-design/components/modal"; | ||
import SpaceBetween from "@cloudscape-design/components/space-between"; | ||
import TextContent from "@cloudscape-design/components/text-content"; | ||
|
||
import { Participant } from "@/lib/admin/useParticipants"; | ||
|
||
interface ActionModalProps { | ||
onDismiss: () => void; | ||
onConfirm: (participant: Participant) => void; | ||
participant: Participant | null; | ||
} | ||
|
||
function CheckInModal({ onDismiss, onConfirm, participant }: ActionModalProps) { | ||
if (participant === null) { | ||
return <Modal visible={false} />; | ||
} | ||
|
||
return ( | ||
<Modal | ||
onDismiss={onDismiss} | ||
visible={true} | ||
footer={ | ||
<Box float="right"> | ||
<SpaceBetween direction="horizontal" size="xs"> | ||
<Button variant="link" onClick={onDismiss}> | ||
Cancel | ||
</Button> | ||
<Button variant="primary" onClick={() => onConfirm(participant)}> | ||
Check In | ||
</Button> | ||
</SpaceBetween> | ||
</Box> | ||
} | ||
header={`Check In ${participant?.first_name} ${participant?.last_name}`} | ||
> | ||
<SpaceBetween size="m"> | ||
<TextContent> | ||
<ul> | ||
{/* TODO: actual instructions for check-in associates */} | ||
<li>Create a badge for the participant ...</li> | ||
<li>Ask participant to sign the SPFB sheet ...</li> | ||
</ul> | ||
</TextContent> | ||
{/* TODO: badge barcode input */} | ||
</SpaceBetween> | ||
</Modal> | ||
); | ||
} | ||
|
||
export default CheckInModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters