Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSVP Form additions #286

Merged
merged 5 commits into from
Feb 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions app/profile/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@
color: black;
}

.modalContent svg {
width: 100%;
max-width: 400px;
height: auto;
}
// .modalContent svg {
// width: 100%;
// max-width: 400px;
// height: auto;
// }

.modalContent h2 {
color: black;
Expand Down
11 changes: 10 additions & 1 deletion components/AcceptRSVPForm/AcceptRSVPForm.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
display: flex;
flex-direction: column;
gap: 2rem;
h2 {
h2,
p {
color: white;
}
}
Expand All @@ -18,6 +19,14 @@
color: white;
}

.form label {
font-size: 1.5rem;
}

.form h4 {
color: red;
}

.formButton {
border-radius: 8px;
border: 2px solid #766947;
Expand Down
41 changes: 35 additions & 6 deletions components/AcceptRSVPForm/AcceptRSVPForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@ import React, { useState } 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 { RSVPDecideAccept } from "@/util/api";
import Loading from "@/components/Loading/Loading";

const schema = yup.object({
displayName: yup.string().required("Please enter a display name"),

discordTag: yup.string().required("Please enter your discord tag"),

avatarId: yup.string().required("Please choose an avatar")
avatarId: yup.string().required("Please choose an avatar"),
codeOfConductAcknowledge: yup
.string()
.oneOf(["YES"], "You must accept the Code of Conduct")
.required("You must accept the Code of Conduct")
});

type AcceptRSVPFormProps = {
Expand Down Expand Up @@ -44,8 +48,7 @@ const AcceptRSVPForm: React.FC<AcceptRSVPFormProps> = ({ closeModal }) => {
setIsLoading(false);
});

setIsLoading(false);
closeModal();
window.location.reload();
};

if (isLoading) {
Expand All @@ -58,7 +61,8 @@ const AcceptRSVPForm: React.FC<AcceptRSVPFormProps> = ({ closeModal }) => {
initialValues={{
displayName: "",
discordTag: "",
avatarId: ""
avatarId: "",
codeOfConductAcknowledge: ""
}}
onSubmit={handleSubmit}
validationSchema={schema}
Expand All @@ -83,6 +87,30 @@ const AcceptRSVPForm: React.FC<AcceptRSVPFormProps> = ({ closeModal }) => {
required
/>

<Checkboxes
name="codeOfConductAcknowledge"
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"
}
]}
/>

<div className={styles.buttons}>
<button
type="button"
Expand All @@ -100,4 +128,5 @@ const AcceptRSVPForm: React.FC<AcceptRSVPFormProps> = ({ closeModal }) => {
</div>
);
};

export default AcceptRSVPForm;
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