Skip to content

Commit

Permalink
Participant has QR code
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinmonisit committed Mar 19, 2024
1 parent d93edfd commit 2d4524b
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 120 deletions.
18 changes: 18 additions & 0 deletions app/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Button } from "@/app/dashboard/components/button"
import OrganizerView from "@/app/dashboard/views/organizerView"
import DirectorView from "@/app/dashboard/views/directorView"
import { UploadWaiver, GetWaiverInfo, GetResume, UploadResume } from '../lib/actions';
import QRCode from "react-qr-code";

import { useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
Expand All @@ -25,6 +26,7 @@ export default function Dashboard() {
const [waiverState, setWaiverState] = useState<any>(null);
const [savingUserProfile, setSavingUserProfile] = useState<boolean>(false);
const [userProfileSubmitText, setUserProfileSubmitText] = useState<string>("Save");
const [showQR, setShowQR] = useState<boolean>(false);

const UserUpdateSchema = z.object({

Expand Down Expand Up @@ -191,6 +193,22 @@ export default function Dashboard() {
onWaiverSubmit={onWaiverSubmit}
/>

<Card className="w-full max-w-2xl">
<CardHeader>
<div className="flex flex-col ">
<div className='flex flex-col'>
<CardTitle>QR Code</CardTitle>
<CardDescription>Use this QR code to check-in or scan-in for events!</CardDescription>
</div>
</div>
</CardHeader>
<CardContent>
<div className="flex flex-col items-center justify-center space-y-4">
<QRCode value={userData?.email} size={256} />
</div>
</CardContent>
</Card>

<Card className="w-full max-w-2xl">
<form onSubmit={handleSubmit(onSubmit)}>

Expand Down
1 change: 0 additions & 1 deletion app/lib/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,6 @@ export async function AttendEventScan(
event: string,
): Promise<string> {
const session = await auth();
let status = 500;

if (session?.user) {
const { email, name } = session.user;
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"react-dom": "18.2.0",
"react-hook-form": "^7.49.3",
"react-icons": "^5.0.1",
"react-qr-code": "^2.0.12",
"react-qr-reader": "3.0.0-beta-1",
"react-qr-scanner": "1.0.0-alpha.11",
"tailwind-merge": "^2.2.0",
Expand Down
143 changes: 24 additions & 119 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2d4524b

Please sign in to comment.