Skip to content

Commit

Permalink
Merge pull request #661 from nwplus/nwhacks-rsvp
Browse files Browse the repository at this point in the history
add safewalk + sponsor email consent, remove covid
  • Loading branch information
DonaldKLee authored Dec 31, 2024
2 parents a8be5c6 + b8d91b5 commit 83ff52c
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 162 deletions.
237 changes: 89 additions & 148 deletions src/components/ApplicationDashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@ const UnRSVPButtonContainer = styled.div`
margin-top: 20px;
`

const SectionLabel = styled.div`
font-weight: bold;
font-size: 1.25rem;
margin-top: 20px;
`

const QuestionLabel = styled.div`
font-weight: bold;
`
Expand Down Expand Up @@ -381,20 +387,20 @@ const Dashboard = ({
setRSVP,
safewalkNote,
setSafewalkInput,
covidWaiverCheck,
setCovidWaiverCheck,
releaseLiabilityCheck,
setReleaseLiabilityCheck,
mediaConsentCheck,
setMediaConsentCheck,
sponsorEmailConsentCheck,
setSponsorEmailConsentCheck,
ageOfMajoritySelect,
setAgeOfMajoritySelect,
willBeAttendingCheck,
setWillBeAttendingCheck,
safewalkSelect,
setSafewalkSelect,
// nwMentorshipSelect,
// setNwMentorshipSelect,
nwMentorshipSelect,
setNwMentorshipSelect,
marketingFeatureSelect,
setMarketingFeatureSelect,
username,
Expand All @@ -409,13 +415,13 @@ const Dashboard = ({
}) => {
const { activeHackathon } = useHackathon()
// const [safewalk, setSafewalkCheckbox] = useState(safewalkNote || false)
const [covidWaiver, setCovidWaiver] = useState(covidWaiverCheck || undefined)
const [releaseLiability, setReleaseLiability] = useState(releaseLiabilityCheck || undefined)
const [mediaConsent, setMediaConsent] = useState(mediaConsentCheck || undefined)
const [sponsorEmailConsent, setSponsorEmailConsent] = useState(sponsorEmailConsentCheck || false)
// const [ageOfMajority, setAgeOfMajority] = useState(ageOfMajoritySelect || undefined)
const [willBeAttending, setWillBeAttending] = useState(willBeAttendingCheck || false)
const [safewalk, setSafewalk] = useState(safewalkSelect || undefined)
// const [nwMentorship, setNwMentorship] = useState(nwMentorshipSelect || undefined)
const [safewalk, setSafewalk] = useState(safewalkSelect || false)
const [nwMentorship, setNwMentorship] = useState(nwMentorshipSelect || false)
const [marketingFeature, setMarketingFeature] = useState(marketingFeatureSelect || false)

const hackerRSVPStatus = hackerStatuses()[hackerStatus]?.sidebarText
Expand All @@ -424,14 +430,10 @@ const Dashboard = ({
const [rsvpErrorMessage, setRsvpErrorMessage] = useState('')

const askSafewalk = activeHackathon === 'nwhacks' || activeHackathon === 'cmd-f'
// const handleChange = () => {
// setSafewalkCheckbox(!safewalk)
// setSafewalkInput(!safewalkNote)
// }

const handleCovidWaiverChange = () => {
setCovidWaiver(!covidWaiver)
setCovidWaiverCheck(!covidWaiverCheck)
const handleSafewalkChange = () => {
setSafewalk(!safewalk)
setSafewalkSelect(!safewalk)
}

const handleReleaseLiabilityChange = () => {
Expand All @@ -444,6 +446,11 @@ const Dashboard = ({
setMediaConsentCheck(!mediaConsentCheck)
}

const handleSponsorEmailConsentChange = () => {
setSponsorEmailConsent(!sponsorEmailConsent)
setSponsorEmailConsentCheck(!sponsorEmailConsentCheck)
}

// const handleAgeOfMajoritySelectChange = e => {
// setAgeOfMajority(e.target.value)
// setAgeOfMajoritySelect(e.target.value)
Expand All @@ -454,29 +461,18 @@ const Dashboard = ({
setWillBeAttendingCheck(!willBeAttendingCheck)
}

const handleSafewalkSelectChange = e => {
setSafewalk(e.target.value)
setSafewalkSelect(e.target.value)
const handleNwMentorshipChange = () => {
setNwMentorship(!nwMentorship)
setNwMentorshipSelect(!nwMentorship)
}

// const handleNwMentorshipSelectChange = e => {
// setNwMentorship(e.target.value)
// setNwMentorshipSelect(e.target.value)
// }

const handleMarketingFeatureChange = value => {
setMarketingFeature(value)
setMarketingFeatureSelect(value)
const handleMarketingFeatureChange = () => {
setMarketingFeature(!marketingFeature)
setMarketingFeatureSelect(!marketingFeature)
}

const handleRSVPClick = () => {
if (
isRsvpOpen &&
willBeAttending &&
(askSafewalk ? safewalk : true) &&
covidWaiver &&
releaseLiability
) {
if (isRsvpOpen && willBeAttending && releaseLiability) {
setRSVP(canRSVP)
}
if (!isRsvpOpen) {
Expand Down Expand Up @@ -527,49 +523,10 @@ const Dashboard = ({
</SelectOptionContainer>
</SelectContainer>

{askSafewalk && (
<SelectContainer>
<QuestionLabel>
Safewalk option <Required />
</QuestionLabel>
<P>
While {copyText[activeHackathon].hackathonNameShort} is a 24 hour hackathon, you
are not required to sleep there. If you live closeby, we recommend that you sleep
at home on the night of {relevantDates.hackathonWeekend.split('-')[0]}. For
safety, we are offering a service where nwPlus organizers or volunteers walk
hackers anywhere on campus.
</P>
<P>Would you like to request this service?</P>
<SelectOptionContainer>
<input
type="radio"
id="safewalkYes"
name="safewalkYes"
value="safewalkYes"
checked={safewalk === 'safewalkYes'}
onChange={handleSafewalkSelectChange}
/>
<label htmlFor="safewalkYes">Yes</label>
</SelectOptionContainer>

<SelectOptionContainer>
<input
type="radio"
id="safewalkNo"
name="safewalkNo"
value="safewalkNo"
checked={safewalk === 'safewalkNo'}
onChange={handleSafewalkSelectChange}
/>
<label htmlFor="safewalkNo">No</label>
</SelectOptionContainer>
</SelectContainer>
)}

<QuestionContainer>
<QuestionLabel>
<SectionLabel>
Waivers <Required />
</QuestionLabel>
</SectionLabel>
<P>
Please read the waivers carefully. Checking the box is equivalent to signing the
waiver. If you will be under 19 on {relevantDates.hackathonWeekend.split('-')[0]},
Expand Down Expand Up @@ -603,29 +560,6 @@ const Dashboard = ({
/>
</QuestionContainer>

<QuestionContainer>
<QuestionLabel>
COVID Liability <Required />
</QuestionLabel>
<P>This waiver clarifies that nwPlus is not liable for any COVID-19 related risks.</P>
<WaiverLinkContainer>
<A
bolded
width="130px"
target="_blank"
rel="noopener noreferrer"
href={waiversAndForms.covid}
>
Read Full Waiver.
</A>{' '}
</WaiverLinkContainer>
<Checkbox
checked={covidWaiver}
onChange={handleCovidWaiverChange}
label="I have read the COVID Liability Waiver and agree to its terms."
/>
</QuestionContainer>

<QuestionContainer>
<QuestionLabel>Media Consent</QuestionLabel>
<P>
Expand All @@ -651,6 +585,41 @@ const Dashboard = ({
/>
</QuestionContainer>

<QuestionContainer>
<SectionLabel>Other information</SectionLabel>
</QuestionContainer>

{askSafewalk && (
<SelectContainer>
<QuestionLabel>Safewalk</QuestionLabel>
<P>
While {copyText[activeHackathon].hackathonNameShort} is a 24 hour hackathon, you
are not required to sleep there. If you live closeby, we recommend that you sleep
at home on the night of {relevantDates.hackathonWeekend.split('-')[0]}. For
safety, we are offering a service where nwPlus organizers or volunteers walk
hackers anywhere on campus.
</P>
<Checkbox
checked={safewalk}
onChange={handleSafewalkChange}
label="Yes, I would like to request this service"
/>
</SelectContainer>
)}

<QuestionContainer>
<QuestionLabel>Sponsor Email Consent</QuestionLabel>
<P>
Would you like to receive hiring opportunities, promotions, and information from
participating {copyText[activeHackathon].hackathonNameShort} sponsors?
</P>
<Checkbox
checked={sponsorEmailConsent}
onChange={handleSponsorEmailConsentChange}
label={`I authorize the use of my email to receive emails from ${copyText[activeHackathon].hackathonNameShort} sponsors`}
/>
</QuestionContainer>

<SelectContainer>
<QuestionLabel>
{copyText[activeHackathon].hackathonName} Feature Preference
Expand All @@ -659,29 +628,26 @@ const Dashboard = ({
We are looking for people to be featured in interview videos about their experience
at {copyText[activeHackathon].hackathonNameShort}. Filming will take ~10 mins and
will take place during the hackathon. If chosen, our team will reach out with
further instructions. Are you interested in participating?{' '}
further instructions.
</P>
<SelectOptionContainer>
<Checkbox
checked={marketingFeature}
onChange={() => handleMarketingFeatureChange(true)}
label="Yes"
/>
</SelectOptionContainer>
<SelectOptionContainer>
<Checkbox
checked={!marketingFeature}
onChange={() => handleMarketingFeatureChange(false)}
label="No"
/>
</SelectOptionContainer>
<Checkbox
checked={marketingFeature}
onChange={handleMarketingFeatureChange}
label="Yes, I am interested in participating in feature videos"
/>
</SelectContainer>

{/* <SelectContainer>
<SelectContainer>
<QuestionLabel>nwMentorship Program</QuestionLabel>
<P>
I would like to participate in the nwMentorship program to connect with an industry
mentor and have submitted my interest through this{' '}
nwMentorship is a program that runs from January 2025 to March 2025 designed to
foster professional and personal growth by connecting experienced mentors with
hackers seeking guidance and industry insight.
</P>
{/* hardcoded for nwHacks */}
<P>
If interested in participating in nwMentorship as a mentee and can commit 3-5 hours
per month to the program, please fill out this {' '}
<A
bolded
color="primary"
Expand All @@ -690,32 +656,15 @@ const Dashboard = ({
href={waiversAndForms.nwMentorship}
>
Google Form
</A>{' '}
</A>
{' '} by Jan 8th, 11:59pm.
</P>
<SelectOptionContainer>
<input
type="radio"
id="nwMentorshipYes"
name="nwMentorshipYes"
value="nwMentorshipYes"
checked={nwMentorship === 'nwMentorshipYes'}
onChange={handleNwMentorshipSelectChange}
/>
<label htmlFor="nwMentorshipYes">Yes</label>
</SelectOptionContainer>
<SelectOptionContainer>
<input
type="radio"
id="nwMentorshipNo"
name="nwMentorshipNo"
value="nwMentorshipNo"
checked={nwMentorship === 'nwMentorshipNo'}
onChange={handleNwMentorshipSelectChange}
/>
<label htmlFor="nwMentorshipNo">No</label>
</SelectOptionContainer>
</SelectContainer> */}
<Checkbox
checked={nwMentorship}
onChange={handleNwMentorshipChange}
label="Yes, I would like to participate in the nwMentorship program and have filled out the form"
/>
</SelectContainer>
</>
)}

Expand All @@ -732,15 +681,7 @@ const Dashboard = ({
onClick={handleRSVPClick}
shouldDisplay={canRSVP || hackerStatus === 'acceptedAndAttending'}
color={canRSVP ? 'primary' : 'secondary'}
disabled={
!(
isRsvpOpen &&
willBeAttending &&
(askSafewalk ? safewalk : true) &&
covidWaiver &&
releaseLiability
)
}
disabled={!(isRsvpOpen && willBeAttending && releaseLiability)}
>
RSVP
</RSVPButton>
Expand Down
Loading

0 comments on commit 83ff52c

Please sign in to comment.