Skip to content

Commit

Permalink
Implemented Accept/Reject Functions for RSVP Modals (#283)
Browse files Browse the repository at this point in the history
* Added profile page and accepted page updates

* Implemented accept/reject modal logic; integrated with API

---------

Co-authored-by: J164 <[email protected]>
  • Loading branch information
miguelaenlle and J164 authored Feb 2, 2025
1 parent b22aa4c commit f5be26d
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 27 deletions.
35 changes: 30 additions & 5 deletions components/Profile/RSVP/ModalViews/Accepted.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React from "react";
import styles from "./styles.module.scss";
import OlympianButton from "@/components/OlympianButton/OlympianButton";
import { RSVPDecideAccept, RSVPDecideDecline } from "@/util/api";

type AcceptedType = "PRO" | "PRO_TO_GENERAL" | "GENERAL";

Expand All @@ -9,12 +11,20 @@ type AcceptedProps = {
};

export default function Accepted({ acceptedType, reimburse }: AcceptedProps) {
const handleConfirm = async () => {
await RSVPDecideAccept();
};

const handleDecline = async () => {
await RSVPDecideDecline();
};

return (
<ChooseRSVP
acceptedType={acceptedType}
reimburse={reimburse}
handleConfirm={() => {}}
handleDecline={() => {}}
handleConfirm={handleConfirm}
handleDecline={handleDecline}
/>
);
}
Expand All @@ -26,7 +36,12 @@ type ChooseRSVPProps = {
handleDecline: () => void;
};

export function ChooseRSVP({ reimburse, acceptedType }: ChooseRSVPProps) {
export function ChooseRSVP({
reimburse,
acceptedType,
handleConfirm,
handleDecline
}: ChooseRSVPProps) {
return (
<div className={styles.container}>
<div className={styles.textBlock}>
Expand All @@ -46,8 +61,18 @@ export function ChooseRSVP({ reimburse, acceptedType }: ChooseRSVPProps) {
)}
</div>
<div className={styles.buttonGroup}>
{/* <ConfirmButton onClick={handleConfirm} />
<DeclineButton onClick={handleDecline} /> */}
<OlympianButton
text="Confirm"
onClick={handleConfirm}
medium
gold
/>
<OlympianButton
text="Decline"
onClick={handleDecline}
medium
blue
/>
</div>
</div>
);
Expand Down
52 changes: 30 additions & 22 deletions components/Profile/RSVP/ModalViews/Rejected.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@ import styles from "./styles.module.scss";
export function Rejected() {
return (
<div className={styles.container}>
<b>
Unfortunately, we were unable to offer you a spot at
HackIllinois
</b>
<b>
Email us at{" "}
<a href="mailto:[email protected]">
[email protected]
</a>{" "}
if you have any questions!
</b>
<p>
<b>
Unfortunately, we were unable to offer you a spot at
HackIllinois
</b>
</p>
<p>
<b>
Email us at{" "}
<a href="mailto:[email protected]">
[email protected]
</a>{" "}
if you have any questions!
</b>
</p>
</div>
);
}
Expand All @@ -22,17 +26,21 @@ export function Rejected() {
export function Waitlisted() {
return (
<div className={styles.container}>
<b>
Unfortunately, we have deferred your application decision at
this time.
</b>
<b>
Email us at{" "}
<a href="mailto:[email protected]">
[email protected]
</a>{" "}
if you have any questions!
</b>
<p>
<b>
Unfortunately, we have deferred your application at this
time
</b>
</p>
<p>
<b>
Email us at{" "}
<a href="mailto:[email protected]">
[email protected]
</a>{" "}
if you have any questions!
</b>
</p>
</div>
);
}
12 changes: 12 additions & 0 deletions components/Profile/RSVP/ModalViews/styles.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.buttonGroup {
width: 100%;
display: flex;
margin-top: 15px;
justify-content: center;
align-items: center;
gap: 5px;
}

.container {
color: black;
}

0 comments on commit f5be26d

Please sign in to comment.