generated from acmucsd/website-template
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #15 from acmucsd/alex/faq
Add FAQ
- Loading branch information
Showing
10 changed files
with
548 additions
and
33 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
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
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
'use client'; | ||
|
||
import { useState } from 'react'; | ||
import Accordion from '@mui/material/Accordion'; | ||
import AccordionSummary from '@mui/material/AccordionSummary'; | ||
import AccordionDetails from '@mui/material/AccordionDetails'; | ||
import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; | ||
import styles from './style.module.scss'; | ||
import Typography from '../Typography'; | ||
import { Question } from '@/sections/FAQ/questions'; | ||
|
||
interface FAQAccordionProps { | ||
data: Question[]; | ||
} | ||
|
||
export default function FAQ({ data }: FAQAccordionProps) { | ||
const [expandedIndices, setExpandedIndices] = useState<number[]>([]); | ||
|
||
const handleChange = (panelIndex: number) => (_e: React.SyntheticEvent, newExpanded: boolean) => { | ||
if (newExpanded) { | ||
setExpandedIndices([...expandedIndices, panelIndex]); | ||
} else { | ||
setExpandedIndices(expandedIndices.filter(index => index !== panelIndex)); | ||
} | ||
}; | ||
|
||
return ( | ||
<> | ||
{data.map((questionObject, index) => ( | ||
<Accordion | ||
elevation={0} | ||
expanded={expandedIndices.includes(index)} | ||
onChange={handleChange(index)} | ||
className={`${styles.accordionRoot} ${styles.accordion}`} | ||
key={questionObject.question} | ||
> | ||
<AccordionSummary | ||
expandIcon={<ExpandMoreIcon className={styles.expandIcon} />} | ||
className={styles.accordionSummary} | ||
> | ||
<Typography variant="body/large" className={styles.accordionQuestion}> | ||
{questionObject.question} | ||
</Typography> | ||
</AccordionSummary> | ||
<AccordionDetails className={styles.accordionDetails}> | ||
<Typography variant="body/medium" className={styles.accordionAnswer}> | ||
{questionObject.answer} | ||
</Typography> | ||
</AccordionDetails> | ||
</Accordion> | ||
))} | ||
</> | ||
); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
@use '../../styles/vars.scss' as vars; | ||
|
||
.accordion { | ||
box-shadow: none; | ||
margin: 0 !important; | ||
padding: 0.5rem 0; | ||
border-bottom: none; | ||
|
||
&:first-of-type { | ||
border-top: none; | ||
} | ||
|
||
&:last-of-type { | ||
border-bottom-left-radius: 0; | ||
border-bottom-right-radius: 0; | ||
border-bottom: 1px solid vars.$neutral; | ||
} | ||
} | ||
|
||
.accordionRoot { | ||
background-color: transparent !important; | ||
border-top: 1px solid vars.$neutral; | ||
|
||
&:before { | ||
display: none; | ||
} | ||
} | ||
|
||
.accordionSummary { | ||
padding: 0 1rem; | ||
flex-direction: row-reverse; | ||
|
||
:global(.MuiAccordionSummary-content) { | ||
margin: 0; | ||
} | ||
|
||
:global(.MuiAccordionSummary-expandIconWrapper) { | ||
margin-right: 1rem; | ||
transform: rotate(-90deg); | ||
|
||
&.Mui-expanded { | ||
transform: rotate(0deg); | ||
} | ||
} | ||
} | ||
|
||
.accordionDetails { | ||
padding: 1rem 1rem 1rem 2rem; | ||
color: vars.$white; | ||
} | ||
|
||
.expandIcon { | ||
color: vars.$white; | ||
min-width: 24px; | ||
} | ||
|
||
.accordionQuestion { | ||
color: vars.$white; | ||
} | ||
|
||
.accordionAnswer { | ||
color: vars.$white; | ||
|
||
a { | ||
color: vars.$blue; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import Typography from '@/components/Typography'; | ||
import { QUESTIONS } from './questions'; | ||
import styles from './style.module.scss'; | ||
import FAQAccordion from '@/components/FAQAccordion'; | ||
|
||
const FAQ: React.FC = () => { | ||
return ( | ||
<section className={styles.container}> | ||
<Typography variant="display/heavy/small" className={styles.title}> | ||
Frequently Asked Questions | ||
</Typography> | ||
<FAQAccordion data={QUESTIONS} /> | ||
</section> | ||
); | ||
}; | ||
|
||
export default FAQ; |
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import Typography from '@/components/Typography'; | ||
import Link from 'next/link'; | ||
|
||
export interface Question { | ||
question: string; | ||
answer: React.ReactNode; | ||
} | ||
|
||
export const QUESTIONS: Question[] = [ | ||
{ | ||
question: 'How can I register for DiamondHacks?', | ||
answer: ( | ||
<> | ||
Fill out the interest form here ( | ||
<Link href="https://acmurl.com/diamondhacks">https://acmurl.com/diamondhacks</Link>) to be | ||
notified when applications go live! | ||
</> | ||
), | ||
}, | ||
{ | ||
question: 'What is a hackathon?', | ||
answer: | ||
'A hackathon is an event where hackers come together to collaborate, create, and develop projects within a set timeframe (usually 24–48 hours). Participants form teams to brainstorm ideas, write code, and build solutions, with a focus on innovation and creativity.', | ||
}, | ||
{ | ||
question: 'Do I need any prior experience?', | ||
answer: | ||
"No, hackers of any experience levels are welcome! We'll have workshops and mentors to help you get started, and beginners have the chance to win prizes specifically for first time hackers.", | ||
}, | ||
{ | ||
question: 'Where will DiamondHacks be held?', | ||
answer: | ||
'DiamondHacks will be hosted at UC San Diego, in the Computer Science & Engineering Buildings, as well as Jacobs Hall.', | ||
}, | ||
{ | ||
question: 'Who can attend DiamondHacks?', | ||
answer: ( | ||
<> | ||
Any undergraduate students enrolled in <b>any</b> college or university are eligible to | ||
attend! | ||
</> | ||
), | ||
}, | ||
{ | ||
question: 'Who can I reach out to for questions and concerns?', | ||
answer: ( | ||
<> | ||
Please reach out to <Link href="mailto:[email protected]">[email protected]</Link>{' '} | ||
with any questions or concerns about DiamondHacks! | ||
</> | ||
), | ||
}, | ||
]; |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@use '../../styles/vars.scss' as vars; | ||
|
||
.title { | ||
margin-bottom: 2rem; | ||
color: vars.$light-blue; | ||
|
||
@media screen and (max-width: vars.$breakpoint-md) { | ||
font-size: 2.25rem !important; | ||
line-height: 2.625rem !important; | ||
} | ||
} |
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
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
Oops, something went wrong.