-
Couldn't load subscription status.
- Fork 47
Add FAQ page #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: pr-review-workshop
Are you sure you want to change the base?
Add FAQ page #73
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ import ApplyDeveloper from './pages/apply/developer/ApplyDeveloper'; | |
| import ApplyProductDesigner from './pages/apply/product-designer/ApplyProductDesigner'; | ||
| import ApplyProductManager from './pages/apply/product-manager/ApplyProductManager'; | ||
| import Events from './pages/events/Events'; | ||
| import FAQ from './pages/faq/FAQ'; | ||
| import Home from './pages/home/Home'; | ||
| import NotFound from './pages/notfound/NotFound'; | ||
| import People from './pages/people/People'; | ||
|
|
@@ -43,6 +44,7 @@ const App: React.FC = () => { | |
| <Route path="/apply/brand-designer" Component={ApplyBrandDesigner} /> | ||
| <Route path="/projects" Component={Projects} /> | ||
| <Route path="/people" Component={People} /> | ||
| {/* <Route path="/faq" Component={FAQ} /> */} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this commented out? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔧 Comment can be removed |
||
| <Route path="*" Component={NotFound} /> | ||
| </Routes> | ||
| <Footer /> | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,66 @@ | ||||||
| // Mostly copied from src/app/components/Accordion.tsx | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❓ If it's mostly copied, why not just modify that Accordion to support this use case? What are the major differences? |
||||||
|
|
||||||
| import React, { useState } from 'react'; | ||||||
| import { | ||||||
| Accordion as MuiAccordion, | ||||||
| AccordionDetails, | ||||||
| AccordionSummary, | ||||||
| Typography, | ||||||
| Fade, | ||||||
| } from '@material-ui/core'; | ||||||
| import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; | ||||||
| import { makeStyles } from '@material-ui/core/styles'; | ||||||
|
|
||||||
| interface AccordionProps { | ||||||
| sections: any[]; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might be beneficial to create a section type to be used here in place of type any[] There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 Possible type might be something like interface Section {
title: string,
body: React.Element
} |
||||||
| } | ||||||
|
|
||||||
| const useStyles = makeStyles({ | ||||||
| title: { | ||||||
| fontWeight: 500, | ||||||
| }, | ||||||
| }); | ||||||
|
|
||||||
| const Accordion: React.FC<AccordionProps> = (props: any) => { | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔧 Props should be typed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| const classes = useStyles(); | ||||||
| const [showHiddenQuestions, setShowHiddenQuestions] = useState(false); | ||||||
|
|
||||||
| return ( | ||||||
| <> | ||||||
| {props.sections.map((section: any, index: any) => ( | ||||||
| <Fade in timeout={1000 + 200 * index}> | ||||||
| <MuiAccordion> | ||||||
| <AccordionSummary | ||||||
| expandIcon={<ExpandMoreIcon />} | ||||||
| onClick={() => { | ||||||
| console.log('onClick called'); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔧 can get rid of this debug print There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔧 Log can be removed |
||||||
| setShowHiddenQuestions(true); | ||||||
| }} | ||||||
| id="panel1a-header" | ||||||
| > | ||||||
| <Typography | ||||||
| variant="body1" | ||||||
| className={classes.title} | ||||||
| color="primary" | ||||||
| > | ||||||
| {section.title} | ||||||
| </Typography> | ||||||
| </AccordionSummary> | ||||||
| <AccordionDetails> | ||||||
| <Typography variant="body2">{section.body}</Typography> | ||||||
| </AccordionDetails> | ||||||
| </MuiAccordion> | ||||||
| </Fade> | ||||||
| ))} | ||||||
| {showHiddenQuestions && ( | ||||||
| <React.Fragment> | ||||||
| {props.hiddenQuestions.map((question: string) => ( | ||||||
| <>{question}</> | ||||||
| ))} | ||||||
| </React.Fragment> | ||||||
| )} | ||||||
| </> | ||||||
| ); | ||||||
| }; | ||||||
|
|
||||||
| export default Accordion; | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| import React, { | ||
| useCallback, | ||
| useEffect, | ||
| useImperativeHandle, | ||
| useMemo, | ||
| } from 'react'; | ||
| import { Helmet } from 'react-helmet'; | ||
| import { Container, Box, Link } from '@material-ui/core'; | ||
| import Hero from '../../components/Hero'; | ||
| import { ReactComponent as SVG } from './faq.svg'; | ||
| import { Link as RouterLink } from 'react-router-dom'; | ||
| import Accordion from './Accordion'; | ||
|
|
||
| export default function FAQ() { | ||
| // this is the list of FAQs | ||
| const frequently_asked_questions = [ | ||
| { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔧 Can we move these {title, body} constants out of this file? Maybe to a different file? |
||
| title: 'What does C4C stand for?', | ||
| body: 'C4C stands for Code4Community!', | ||
| }, | ||
| { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe abstract the title bodies in this function |
||
| title: 'How does the application process work?', | ||
| // TODO figure out how to link to the apply page from here | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔧 Remove comment |
||
| body: "Visit the apply page and submit your application. We'll reach out to schedule an interview with 1-2 members of our team.", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔧 It looks like line 46 inserts a link, that can maybe be implemented here. |
||
| }, | ||
| { | ||
| title: 'Who do we work with?', | ||
| body: 'We work with nonprofits in the Greater Boston area that strive to improve the community we live in. We look for organizations that have a need for a software solution, but lack the resources to pursue typical development channels.', | ||
| }, | ||
| { | ||
| title: 'How often does C4C meet?', | ||
| body: 'Product team members meet once a week.', | ||
| }, | ||
| { | ||
| title: 'What is the product team structure?', | ||
| body: 'Teams are structured around a single project that everyone works on together. Each team is made up of: a project lead, 1-2 designers, and several software developers.', | ||
| }, | ||
| { | ||
| title: | ||
| 'How many people are in C4C? How many people are on a product team?', | ||
| body: 'Depending on how many partners and projects we are taking on in a semester, our organization size may vary. However, our product teams are usually around 8 members each.', | ||
| }, | ||
| { | ||
| title: 'What have you worked on in the past?', | ||
| body: ( | ||
| <> | ||
| Check out our past projects on our{' '} | ||
| <Link href="https://github.com/Code-4-Community">Github</Link>! | ||
| </> | ||
| ), | ||
| }, | ||
| ]; | ||
|
|
||
| useEffect(() => { | ||
| window.scrollTo(0, 0); | ||
| }, []); | ||
|
|
||
| return ( | ||
| <Container maxWidth="lg"> | ||
| <Hero | ||
| title="FAQs" | ||
| subtitle="Everything you need to know about our product teams." | ||
| SvgNode={SVG} | ||
| /> | ||
| <Container maxWidth="xs"> | ||
| <Box py="5vh"> | ||
| <Accordion sections={frequently_asked_questions} /> | ||
| </Box> | ||
| </Container> | ||
| </Container> | ||
| ); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔧 Is this meant to be commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 If so, please leave a comment explaining why and when it should be uncommented.