Skip to content

Commit

Permalink
Make changes requested by MLH (#497)
Browse files Browse the repository at this point in the history
* Addressing issues asked about by MLH

* Changing VandyHacks X -> VandyHacks XI

* Run Prettier

* Getting rid of old changes

* Unused packages

---------

Co-authored-by: kyleburgess2025 <[email protected]>
  • Loading branch information
kyleburgess2025 and kyleburgess2025 authored Aug 17, 2024
1 parent ba1c0ae commit b13e746
Show file tree
Hide file tree
Showing 20 changed files with 128 additions and 43 deletions.
3 changes: 2 additions & 1 deletion components/Organizer/ApplicantsTab/ApplicantsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,12 @@ const APPLICATION_KEY_MAP = {
phoneNumber: 'Phone Number',
school: 'School',
major: 'Major',
graduationYear: 'Graduation Year',
yearOfStudy: 'Year Of Study',
address1: 'Address 1',
address2: 'Address 2',
city: 'City',
state: 'State',
country: 'Country',
zip: 'Zip',
race: 'Race',
dietaryRestrictions: 'Dietary Restrictions',
Expand Down
109 changes: 94 additions & 15 deletions components/hacker/HackerDash.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
import { useEffect, useState } from 'react';
import { BugOutlined, UploadOutlined } from '@ant-design/icons';
import { Button, Checkbox, DatePicker, Form, Input, Radio, Skeleton, Upload, UploadFile } from 'antd';
import {
AutoComplete,
Button,
Checkbox,
DatePicker,
Dropdown,
Form,
Input,
Radio,
Skeleton,
Upload,
UploadFile,
} from 'antd';
import useSWR from 'swr';
import Leaderboard from './Leaderboard';
import JudgingSchedule from './JudgingSchedule';
Expand All @@ -23,6 +35,11 @@ type HackerProps = {
setUserApplicationStatus: (newType: number) => void;
};

type DropdownItem = {
label: string;
value: string;
};

export default function HackerDash({ userApplicationStatus, setUserApplicationStatus }: HackerProps) {
const [loading, setLoading] = useState(false);
const { data: session, status } = useSession();
Expand Down Expand Up @@ -58,6 +75,40 @@ export default function HackerDash({ userApplicationStatus, setUserApplicationSt
{ revalidateOnFocus: false, revalidateOnMount: true }
);

// get country options
const [countryOptions, setCountryOptions] = useState([]);
const [country, setCountry] = useState('');
const { data: countries } = useSWR(
'https://restcountries.com/v3.1/all',
async url => {
const res = await fetch(url, { method: 'GET' });
const jsonRes = await res.json();
const countryList = jsonRes.map((country: any) => {
return { label: country.name.common, value: country.name.common };
});
setCountryOptions(countryList);
return countryList;
},
{ revalidateOnFocus: false, revalidateOnMount: true }
);

// get school options
const [schoolOptions, setSchoolOptions] = useState([]);
const [school, setSchool] = useState('');
const { data: schools } = useSWR(
'http://universities.hipolabs.com/search',
async url => {
const res = await fetch(url, { method: 'GET' });
const jsonRes = await res.json();
const schoolList = jsonRes.map((school: any) => {
return { label: school.name, value: school.name };
});
setSchoolOptions(schoolList);
return schoolList;
},
{ revalidateOnFocus: false, revalidateOnMount: true }
);

const [hackathonStarted, setHackathonStarted] = useState(false);

const onFinish = async (values: any) => {
Expand Down Expand Up @@ -235,7 +286,19 @@ export default function HackerDash({ userApplicationStatus, setUserApplicationSt
label={<p className={styles.Label}>School</p>}
name="school"
rules={[{ required: true, message: 'Please input your school!' }]}>
<Input className={styles.Input} />
<AutoComplete
options={schoolOptions}
onSearch={text => {
setSchoolOptions(
schools.filter((school: DropdownItem) =>
school.label.toLowerCase().includes(text.toLowerCase())
)
);
}}
value={school}
onChange={data => setSchool(data)}
className={styles.Input}
/>
</Form.Item>
<Form.Item
label={<p className={styles.Label}>Major</p>}
Expand All @@ -245,14 +308,13 @@ export default function HackerDash({ userApplicationStatus, setUserApplicationSt
</Form.Item>
<Form.Item
label={<p className={styles.Label}>Graduation Year</p>}
name="graduationYear"
rules={[{ required: true, message: 'Please select your graduation year!' }]}>
name="yearOfStudy"
rules={[{ required: true, message: 'Please select your year of study!' }]}>
<Radio.Group>
<Radio.Button value="2024">2024</Radio.Button>
<Radio.Button value="2025">2025</Radio.Button>
<Radio.Button value="2026">2026</Radio.Button>
<Radio.Button value="2027">2027</Radio.Button>
<Radio.Button value="other">Other</Radio.Button>
<Radio.Button value="freshman">Freshman</Radio.Button>
<Radio.Button value="sophomore">Sophomore</Radio.Button>
<Radio.Button value="junior">Junior</Radio.Button>
<Radio.Button value="senior">Senior</Radio.Button>
</Radio.Group>
</Form.Item>
<Form.Item
Expand All @@ -278,7 +340,6 @@ export default function HackerDash({ userApplicationStatus, setUserApplicationSt
rules={[{ required: true, message: 'Please input your state!' }]}>
<Input className={styles.Input} />
</Form.Item>

<Form.Item
label={<p className={styles.Label}>ZIP Code</p>}
name={'zip'}
Expand All @@ -299,6 +360,25 @@ export default function HackerDash({ userApplicationStatus, setUserApplicationSt
<Input className={styles.Input} />
</Form.Item>

<Form.Item
label={<p className={styles.Label}>Country</p>}
name={'country'}
rules={[{ required: true, message: 'Please input your country!' }]}>
<AutoComplete
options={countryOptions}
onSearch={text => {
setCountryOptions(
countries.filter((country: DropdownItem) =>
country.label.toLowerCase().includes(text.toLowerCase())
)
);
}}
value={country}
onChange={data => setCountry(data)}
className={styles.Input}
/>
</Form.Item>

<Form.Item
name="race"
label={<p className={styles.Label}>Race</p>}
Expand Down Expand Up @@ -526,15 +606,14 @@ export default function HackerDash({ userApplicationStatus, setUserApplicationSt
},
]}>
<Checkbox style={{ color: 'white' }}>
I authorize you to share my application/registration information for event
administration, ranking, MLH administration, pre- and post-event informational
emails, and occasional emails about hackathons in line with the MLH Privacy
Policy. I further agree to the terms of both the{' '}
I authorize you to share my application/registration information with Major
League Hacking for event administration, ranking, and MLH administration in-line
with the MLH Privacy Policy. I further agree to the terms of both the{' '}
<a
style={{ color: '#027cff' }}
target="_blank"
rel="noopener noreferrer"
href="https://github.com/MLH/mlh-policies/tree/master/prize-terms-and-conditions">
href="https://github.com/MLH/mlh-policies/blob/main/contest-terms.md">
MLH Contest Terms and Conditions
</a>{' '}
and the{' '}
Expand Down
2 changes: 1 addition & 1 deletion components/hacker/RegistrationLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const RegistrationLogo = () => {
<>
<Form.Item className={styles.TitleLogo}> </Form.Item>
<div className={styles.TitleContainer}>
<div className={styles.Title}>VandyHacks X Registration</div>
<div className={styles.Title}>VandyHacks XI Registration</div>
</div>
</>
);
Expand Down
2 changes: 1 addition & 1 deletion components/signIn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function SignIn() {
<Image className={styles.Logo} src="/vh-logo.png" alt="VandyHacks Logo" preview={false} />
<br />
<div className={styles.Title} style={{ color: 'white' }}>
VandyHacks X
VandyHacks XI
</div>
<Button
size="large"
Expand Down
2 changes: 1 addition & 1 deletion email/html/accepted.html
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@
color: #637381;
">
Congratulations! You’re invited to be a part of
<b>VandyHacks X: Neon Edition</b>! We enjoyed
<b>VandyHacks XI: Racing Edition</b>! We enjoyed
reading your application and would love to see
your ideas come to life during our event on
<b>October 28th-29th</b>!
Expand Down
2 changes: 1 addition & 1 deletion email/html/confirmed.html
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@
color: #637381;
">
We're so excited that you'll be joining us for
<b>VandyHacks X: Neon Edition</b>!
<b>VandyHacks XI: Racing Edition</b>!
</div>
</td>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions email/html/rejected.html
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,8 @@
text-align: left;
color: #637381;
">
Thank you for your interest in VandyHacks X:
Neon Edition. Unfortunately, we are unable to
Thank you for your interest in VandyHacks XI:
Racing Edition. Unfortunately, we are unable to
offer you a spot at this year's event.
</div>
</td>
Expand Down
6 changes: 3 additions & 3 deletions email/html/reminderToSubmit.html
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@
text-align: left;
color: #637381;
">
We would love to have you join VandyHacks X!
We would love to have you join VandyHacks XI!
Make sure you apply at
<a href="https://vandyhacks.org"
>vandyhacks.org</a
Expand Down Expand Up @@ -885,8 +885,8 @@
of any future
emails
pertaining to
VandyHacks X:
Neon Edition
VandyHacks XI:
Racig Edition
applications,
please click
<a
Expand Down
6 changes: 3 additions & 3 deletions email/html/submitted.html
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@
Thanks for taking the time to complete your
application! We're so excited that you're
interested in being a part of
<b>VandyHacks X: Neon Edition</b>.
<b>VandyHacks XI: Racing Edition</b>.
</div>
</td>
</tr>
Expand Down Expand Up @@ -874,8 +874,8 @@
of any future
emails
pertaining to
VandyHacks X:
Neon Edition
VandyHacks XI:
Racing Edition
applications,
please click
<a
Expand Down
6 changes: 3 additions & 3 deletions email/html/travelForm.html
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@
Thanks for taking the time to complete your
application! We’re so excited that you’re
interested in being a part of
<b>VandyHacks X: Neon Edition</b>.
<b>VandyHacks XI: Racing Edition</b>.
</div>
</td>
</tr>
Expand Down Expand Up @@ -957,8 +957,8 @@
of any future
emails
pertaining to
VandyHacks X:
Neon Edition
VandyHacks XI:
Racing Edition
applications,
please click
<a
Expand Down
2 changes: 1 addition & 1 deletion email/templates/accepted.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default async (user: UserData): Promise<SendEmailRequest> => ({
Text: {
Charset: 'UTF-8',
Data: `Hi ${escapeChars(user.name || user.name)},
Congratulations! You’re invited to be a part of VandyHacks X: Neon Edition! We enjoyed reading your application and would love to see your ideas come to life during our event on October 28th-29th!
Congratulations! You’re invited to be a part of VandyHacks XI: Racing Edition! We enjoyed reading your application and would love to see your ideas come to life during our event on October 28th-29th!
Head over to the application portal here and confirm your attendance by October 26th, 12:00 PM CDT.
Expand Down
2 changes: 1 addition & 1 deletion email/templates/confirmed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default async (user: UserData): Promise<SendEmailRequest> => ({
Text: {
Charset: 'UTF-8',
Data: `Hey ${escapeChars(user.name)},
We're so excited that you'll be joining us for VandyHacks X: Neon Edition!
We're so excited that you'll be joining us for VandyHacks XI: Racing Edition!
This email is just to confirm that you've RSVPed to our event. We'll be in touch again soon with more information on our opening ceremony, but as a reminder, festivities will start at 12:00 PM CDT Saturday, October 28th, and wrap up by 5:30 PM CDT Sunday, October 29th.
Expand Down
2 changes: 1 addition & 1 deletion email/templates/rejected.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default async (user: UserData): Promise<SendEmailRequest> => ({
Text: {
Charset: 'UTF-8',
Data: `Hi ${escapeChars(user.name)},
Thank you for your interest in VandyHacks X: Neon Edition. Unfortunately, we are unable to offer you a spot at this year's event.
Thank you for your interest in VandyHacks XI: Racing Edition. Unfortunately, we are unable to offer you a spot at this year's event.
We really appreciate your interest and hope you will apply to another VandyHacks opportunity in the future.
Best,
The VandyHacks Team`,
Expand Down
2 changes: 1 addition & 1 deletion email/templates/reminderToSubmit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default async (user: UserData): Promise<SendEmailRequest> => ({
Charset: 'UTF-8',
Data: `Applications Closing Soon!
Hi ${escapeChars(user.name)},
We’ve noticed you’ve created an application with us, but we do not have a record of your submission. We would love to have you join VandyHacks X!
We’ve noticed you’ve created an application with us, but we do not have a record of your submission. We would love to have you join VandyHacks XI: Racing Edition!
Make sure you apply at vandyhacks.org by October 16th, at 11:59pm to have the chance to create unique projects, win prizes, attend workshops/speaker events, network with our sponsors, receive cool swag, eat free food, and so much more!
Feel free to email us at [email protected] if you have any questions
Cheers,
Expand Down
2 changes: 1 addition & 1 deletion email/templates/submitted.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default async (user: UserData): Promise<SendEmailRequest> => ({
Charset: 'UTF-8',
Data: `Thank you for applying!
Hi ${escapeChars(user.name)},
Thanks for taking the time to complete your application! We’re so excited that you’re interested in being a part of VandyHacks X: Neon Edition.
Thanks for taking the time to complete your application! We’re so excited that you’re interested in being a part of VandyHacks XI: Racing Edition.
We will be reviewing your submission soon, so be on the lookout for another email regarding your status.
Until then, stay hyped about VandyHacks! Follow us on Instagram to get the latest VH updates!
Cheers,
Expand Down
4 changes: 2 additions & 2 deletions email/templates/travelForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default async (user: UserData): Promise<SendEmailRequest> => ({
Charset: 'UTF-8',
Data: `You've indicated you'd like to apply for a travel reimbursement!
Hi ${escapeChars(user.name)},
Thanks for taking the time to complete your application! We’re so excited that you’re interested in being a part of VandyHacks X: Neon Edition.
Thanks for taking the time to complete your application! We’re so excited that you’re interested in being a part of VandyHacks XI: Racing Edition.
We will be reviewing your submission soon, so be on the lookout for another email regarding your status.
Until then, stay hyped about VandyHacks! Follow us on Instagram to get the latest VH updates!
Cheers,
Expand All @@ -36,7 +36,7 @@ export default async (user: UserData): Promise<SendEmailRequest> => ({
},
Subject: {
Charset: 'UTF-8',
Data: 'Apply for a Travel Reimbursement to VandyHacks X!',
Data: 'Apply for a Travel Reimbursement to VandyHacks XI!',
},
},
Source: 'VandyHacks <[email protected]>',
Expand Down
6 changes: 5 additions & 1 deletion models/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const ApplicationSchema = new Schema(
type: String,
required: true,
},
graduationYear: {
yearOfStudy: {
type: String,
required: true,
},
Expand All @@ -55,6 +55,10 @@ export const ApplicationSchema = new Schema(
type: String,
required: true,
},
country: {
type: String,
required: true,
},
zip: {
type: String,
required: true,
Expand Down
4 changes: 2 additions & 2 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export default function Page() {
return (
<>
<Head>
<title>VandyHacks X</title>
<meta property="og:title" content="VandyHacks X" />
<title>VandyHacks XI</title>
<meta property="og:title" content="VandyHacks XI" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://apply.vandyhacks.org" />
<meta property="og:image" content="/vh.png" />
Expand Down
2 changes: 1 addition & 1 deletion pages/report.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const ReportBug = () => {
<>
<Head>
<title>Report a bug!</title>
<meta property="og:title" content="VandyHacks X - Report a bug" />
<meta property="og:title" content="VandyHacks XI - Report a bug" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://apply.vandyhacks.org" />
<meta property="og:image" content="/vh.png" />
Expand Down
Loading

0 comments on commit b13e746

Please sign in to comment.