Skip to content

Commit

Permalink
RSVP Form additions
Browse files Browse the repository at this point in the history
  • Loading branch information
Taran Polavarapu committed Feb 2, 2025
1 parent f5be26d commit 9de0021
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
41 changes: 39 additions & 2 deletions components/AcceptRSVPForm/AcceptRSVPForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ import React from "react";
import styles from "./AcceptRSVPForm.module.scss";
import { Form, Formik } from "formik";
import * as yup from "yup";
import Checkboxes from "@/components/Form/Checkboxes/Checkboxes";
import TextInput from "@/components/Form/TextInput/TextInput";
import AvatarSelector from "../AvatarSelector/AvatarSelector";
import { setProfile } from "@/util/api";
import Link from "next/link";
import { useRouter } from 'next/router';

const schema = yup.object({
displayName: yup.string().required("Please enter a display name"),
Expand Down Expand Up @@ -37,7 +40,14 @@ const AcceptRSVPForm: React.FC<AcceptRSVPFormProps> = ({ closeModal }) => {
avatarId: avatarId
});
console.log(response);
closeModal();
const router = useRouter();

const refresh = () => {
router.replace(router.asPath);
};

refresh()
//closeModal();
};

return (
Expand All @@ -46,7 +56,8 @@ const AcceptRSVPForm: React.FC<AcceptRSVPFormProps> = ({ closeModal }) => {
initialValues={{
displayName: "",
discordTag: "",
avatarId: ""
avatarId: "",
codeOfConductAcknowledge: "NO"
}}
onSubmit={handleSubmit}
validationSchema={schema}
Expand All @@ -71,6 +82,32 @@ const AcceptRSVPForm: React.FC<AcceptRSVPFormProps> = ({ closeModal }) => {
required
/>

<Checkboxes
name="codeOfConductAcknowledge"
required
label={
<p>
To participate in HackIllinois, you must
accept our{" "}
<Link
prefetch={false}
href="/legal/code-of-conduct"
target="_blank"
>
Code of Conduct
</Link>
:
</p>
}
options={[
{
label: "I accept the Code of Conduct",
value: "YES"
}
]}
blue
/>

<div className={styles.buttons}>
<button
type="button"
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@types/react-modal": "^3.16.3",
"clsx": "^2.1.1",
"formik": "^2.4.6",
"next": "^15.1.0",
"next": "^15.1.6",
"qrcode.react": "^4.2.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
Expand Down

0 comments on commit 9de0021

Please sign in to comment.