-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #592 from nwplus/portal-app-questions
Render hacker application on Portal dynamically
- Loading branch information
Showing
27 changed files
with
1,601 additions
and
2,305 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
</> | ||
) | ||
|
Oops, something went wrong.