Skip to content

Commit

Permalink
RSVP form new changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Taran Polavarapu committed Feb 2, 2025
1 parent 9e34ead commit 1e37c16
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions components/AcceptRSVPForm/AcceptRSVPForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ 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';
import { useRouter } from "next/router";

const schema = yup.object({
displayName: yup.string().required("Please enter a display name"),
Expand All @@ -24,7 +24,7 @@ type AcceptRSVPFormProps = {
};

const AcceptRSVPForm: React.FC<AcceptRSVPFormProps> = ({ closeModal }) => {
const router = useRouter(); // Move useRouter() here
const router = useRouter();

const handleSubmit = async ({
displayName,
Expand All @@ -43,8 +43,7 @@ const AcceptRSVPForm: React.FC<AcceptRSVPFormProps> = ({ closeModal }) => {
});
console.log(response);

// Refresh the page after updating the profile
router.replace(router.asPath);
router.replace(router.asPath);
};

return (
Expand Down Expand Up @@ -84,14 +83,14 @@ const AcceptRSVPForm: React.FC<AcceptRSVPFormProps> = ({ closeModal }) => {
required
label={
<p>
To participate in HackIllinois, you must
accept our{" "}
To participate in HackIllinois, you must accept
our{" "}
<Link
prefetch={false}
href="/legal/code-of-conduct"
target="_blank"
>
Code of Conduct
Code of Conduct
</Link>
:
</p>
Expand All @@ -100,7 +99,7 @@ const AcceptRSVPForm: React.FC<AcceptRSVPFormProps> = ({ closeModal }) => {
{
label: "I accept the Code of Conduct",
value: "YES"
}
}
]}
blue
/>
Expand Down

0 comments on commit 1e37c16

Please sign in to comment.