Skip to content

Commit

Permalink
Merge pull request #236 from HackRU/main
Browse files Browse the repository at this point in the history
Making dev up to date with main
  • Loading branch information
avsomers25 authored Nov 19, 2024
2 parents cae5a2f + 1d2b382 commit 09ae919
Show file tree
Hide file tree
Showing 6 changed files with 160 additions and 147 deletions.
17 changes: 12 additions & 5 deletions app/dashboard/components/profileHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ export default function ProfileHeader(props: {
</CardHeader>
<CardContent className="space-y-4">
{userData.registration_status == 'unregistered' && (
<>
<div className="flex flex-row items-center">
<CardTitle>Unregistered – at this point, you will not be able to attend HackRU, we hope to see you in the spring!</CardTitle>
</div>
</>
)}
{false && userData.registration_status == 'unregistered' && (
<>
{waiverState && (
<p className="mt-2 text-xs italic text-green-500">
Expand Down Expand Up @@ -218,18 +225,18 @@ export default function ProfileHeader(props: {
<>
<div className="flex flex-row items-center">
<CardTitle>
Registered! You will be emailed about acceptance soon.
Registered! There is an extremely high chance that you do not have space for you this fall, we hope to see you in spring! Registrations open at least a full month before the event and are first come first serve.
</CardTitle>
</div>
</>
)}
{userData.registration_status == 'waitlisted' && (
{userData.registration_status == 'waitlist' && (
<>
<div className="flex flex-col">
<CardTitle>Delayed Entry</CardTitle>
<div>
<CardDescription>
You will be able to check in after 10:45am on a first come
You will be able to check in after 10:30am on a first come
first serve basis. Please be there as soon as possible to
secure your spot.
</CardDescription>
Expand All @@ -241,7 +248,7 @@ export default function ProfileHeader(props: {
<>
<CardTitle>
You are confirmed! You are guaranteed entry if you check in
between 9am to 10:45am. Aftwards, 10:45 will be check in
between 9am to 10:30am. Afterwards, 10:30am will be check in
acceptance on a first come first serve basis.
</CardTitle>
</>
Expand Down Expand Up @@ -282,7 +289,7 @@ export default function ProfileHeader(props: {
<CardTitle>
You have indicated you are coming. If your status
changes to confirmed you are guaranteed entry
between 9am and 10:45am. After 10:45am, check in
between 9am and 10:30am. After 10:30am, check in
will be first come first serve.
</CardTitle>
<Button
Expand Down
108 changes: 61 additions & 47 deletions app/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,8 @@ export default function Dashboard() {
: 0,
});

if (data.error != ''){
alert(data.error.message)

if (data.error != '') {
alert(data.error.message);
}

setUserData(data.response);
Expand Down Expand Up @@ -440,6 +439,54 @@ export default function Dashboard() {
} else if (userData?.role['director']) {
return <DirectorView userData={userData} />;
} else if (userData?.role.hacker) {
//FALSE SINCE WE WANT TO OPT IN ON REGISTRATION
//REMOVE ONCE OPTIN WORKING AS EXPECTED
if (false && userData?.opt_in == null) {
return (
<div className="flex flex-col items-center justify-center space-y-8 p-4">
<ProfileHeader
userData={userData}
waiverState={waiverState}
handleChangingFile={handleChangingFile}
onWaiverSubmit={onWaiverSubmit}
/>
<Card className="mt-32 w-full max-w-2xl">
<CardHeader>
<CardTitle>
Would you like to opt-in to Major League Hacking emails? You
must choose before you can proceed.
</CardTitle>
<CardDescription>
<Button
onClick={async () => {
const resp = await OptInSelf(true);
if (resp == 'GOOD') {
setUserData({ ...userData, opt_in: true });
}
}}
type="button"
className="mt-10"
>
OPT IN
</Button>
<Button
onClick={async () => {
const resp = await OptInSelf(false);
if (resp == 'GOOD') {
setUserData({ ...userData, opt_in: false });
}
}}
type="button"
className="mx-10"
>
OPT OUT
</Button>
</CardDescription>
</CardHeader>
</Card>
</div>
);
}
return (
<main>
<Navbar />
Expand Down Expand Up @@ -471,39 +518,6 @@ export default function Dashboard() {
</CardHeader>
</Card>
)}
{userData?.opt_in == null && (
<Card className="w-full max-w-2xl">
<CardHeader>
<CardTitle>Would you like to opt-in to Major League Hacking emails</CardTitle>
<CardDescription>
<Button
onClick={async () => {
const resp = await OptInSelf(true)
if (resp == "GOOD"){
setUserData({ ...userData, opt_in: true })
}
}}
type="button"
className="mt-10"
>
OPT IN
</Button>
<Button
onClick={async () => {
const resp = await OptInSelf(false)
if (resp == "GOOD"){
setUserData({ ...userData, opt_in: false })
}
}}
type="button"
className="mx-10"
>
OPT OUT
</Button>
</CardDescription>
</CardHeader>
</Card>
)}
{userData?.registration_status === 'checked_in' && false && (
<Card className="w-full max-w-2xl">
<CardHeader>
Expand Down Expand Up @@ -657,7 +671,7 @@ export default function Dashboard() {
{pointsData && userData.registration_status == 'checked_in' && (
<Card className="w-full max-w-2xl">
<CardHeader>
<CardTitle>Points Information</CardTitle>
<CardTitle className = "text-green-500">Points Information</CardTitle>
<CardDescription>
Your current points balance and total earned points. At the
end of the hackathon, there will be a grand raffle for prizes
Expand All @@ -669,13 +683,13 @@ export default function Dashboard() {
<div className="space-y-2">
<p className="text-lg">
Current Balance:{' '}
<span className="font-bold">
<span className="text-green-500 font-bold">
{pointsData.balance} points
</span>
</p>
<p className="text-lg">
Total Points Earned:{' '}
<span className="font-bold">
<span className="text-green-500 font-bold">
{pointsData.total_points} points
</span>
</p>
Expand All @@ -692,23 +706,23 @@ export default function Dashboard() {
<Card className="w-full max-w-2xl">
<CardHeader>
<CardTitle>Links</CardTitle>
<CardDescription>
Links to various things
</CardDescription>
<CardDescription>Links to various things</CardDescription>
</CardHeader>
<CardContent>

<div className="m-4">
<Button >
<Button>
<a href="/games">Go to Tetris</a>
</Button>
<Button className='mx-2'>
<a href="https://rsvp.withgoogle.com/events/coe-general-form_577b9e/sessions/rutgers-ru-hack">Google Interest Form </a>
<Button className="mx-2">
<a href="https://rsvp.withgoogle.com/events/coe-general-form_577b9e/sessions/rutgers-ru-hack">
Google Interest Form{' '}
</a>
</Button>
</div>
</CardContent>
</Card>
)}
(
<Card className="w-full max-w-2xl">
<CardHeader>
<div className="flex flex-col ">
Expand All @@ -726,7 +740,7 @@ export default function Dashboard() {
</div>
</CardContent>
</Card>

)
<Card className="w-full max-w-2xl">
<CardHeader>
<div className="flex flex-col ">
Expand Down
19 changes: 10 additions & 9 deletions app/dashboard/raffle/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ interface PrizeInfo {
}

const prizeMapping: Record<string, PrizeInfo> = {
prizeA: {
name: 'XBOX',
description: '1TB',
amazon: {
name: 'Amazon Gift Card',
description: '$50 Dollar Amazon Gift Card',
},
prizeB: {
name: 'Backpack',
description: 'Holloway Backpack',
matcha: {
name: 'Matcha Kit',
description: 'Starter Matcha Kit with Matcha Powder and Whisker',
},
prizeC: {
name: 'Backpack 2',
description: 'Spiderman backpack',
blanket: {
name: 'Weighted Blanket',
description: '20 Pound Weighted Blanket',
},
};

Expand Down Expand Up @@ -163,6 +163,7 @@ export default function RafflePage() {
}));

const response = await UpdateBuyIns(buyIns);
console.log(response.response);
if (response.error) {
throw new Error(response.error);
}
Expand Down
Loading

0 comments on commit 09ae919

Please sign in to comment.