Skip to content

Commit

Permalink
Merge pull request #592 from nwplus/portal-app-questions
Browse files Browse the repository at this point in the history
Render hacker application on Portal dynamically
  • Loading branch information
DonaldKLee committed Aug 28, 2024
2 parents 1c24113 + d0f2d7d commit 35bd178
Show file tree
Hide file tree
Showing 27 changed files with 1,601 additions and 2,305 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"dependencies": {
"cross-env": "^7.0.2",
"firebase": "^7.17.1",
"html-react-parser": "^5.1.12",
"html2canvas": "^1.4.1",
"husky": "^4.3.0",
"jspdf": "^2.5.1",
Expand Down
1,206 changes: 114 additions & 1,092 deletions src/components/ApplicationForm/BasicInfo.jsx

Large diffs are not rendered by default.

78 changes: 33 additions & 45 deletions src/components/ApplicationForm/HackathonInfo.jsx
Original file line number Diff line number Diff line change
@@ -1,55 +1,43 @@
import React from 'react'
import React, { useEffect, useState } from 'react'
import { FormSpacing } from './index'
import { A, CenteredH1, P } from '../Typography'
import { useHackathon } from '../../utility/HackathonProvider'
import { getHackerAppQuestions } from '../../utility/firebase'
import parse, { domToReact } from 'html-react-parser'

const HackathonInfo = () => {
const { dbHackathonName } = useHackathon()
const [title, setTitle] = useState('')
const [content, setContent] = useState('')

useEffect(() => {
const fetchQuestions = async () => {
const questions = await getHackerAppQuestions(dbHackathonName, 'Welcome')
setTitle(questions[0].title || '')
setContent(questions[0].content || '')
}
fetchQuestions()
}, [dbHackathonName])

const options = {
replace: ({ name, attribs, children }) => {
if (name === 'p') {
return <P>{domToReact(children, options)}</P>
}
if (name === 'a') {
return (
<A href={attribs.href} target={attribs.target}>
{domToReact(children, options)}
</A>
)
}
},
}
return (
<>
<FormSpacing>
<CenteredH1>
nwPlus is proud to present cmd-f 2024 - Western Canada's largest hackathon celebrating
underrepresented genders in tech.
</CenteredH1>
<P>
We are beyond excited to host the 6th iteration of our hackathon on March 9-10, 2024! 
cmd-f is a hackathon focused on addressing gender inequality in technology. Our main
purpose is to create a safe and dedicated space for gender minorities to hack together.
We’re trying to create access for people who have historically been excluded. We encourage
participation from women, trans, non-binary, Two-Spirit and gender diverse people. Thus,
cmd-f is only open to individuals who identify as an underrepresented gender in
technology. Please make sure your participation in this event is aligned with the
intentions of the event. We also ask all participants who attend to trust that everyone
attending is meant to be here.
</P>
<P>
<span role="img" aria-label="Plant sprout emoji">
🌱 
</span>
Time: March 9-10, 2024 
</P>
<P>
<span role="img" aria-label="Plant sprout emoji">
🌱 
</span>
Location: Life Sciences Institute, UBC
</P>
<P>
Hacker application deadline: <b>March 1, 2024</b>
</P>
<P>
If you have any questions, feel free to reach out to the team at{' '}
<A href="mailto:[email protected]" target="_blank">
[email protected]
</A>
!
</P>
<P>
Learn more at{' '}
<A href="https://cmd-f.nwplus.io/" target="_blank">
cmd-f.nwplus.io
</A>
!
</P>
<CenteredH1>{title}</CenteredH1>
{parse(content, options)}
</FormSpacing>
</>
)
Expand Down
Loading

0 comments on commit 35bd178

Please sign in to comment.