Skip to content

Curate new FAQ sections and add more answers #982

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

Merged
merged 12 commits into from
Dec 21, 2020
71 changes: 64 additions & 7 deletions src/components/FAQLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,80 @@ import { toSlug } from '../../utils/slug'

interface Props {
title: string
questions: string
gettingStartedQuestions: string
generalQuestions: string
bestPracticesQuestions: string
specificationQuestions: string
frontendQuestions: string
rawMarkdownBody: string
}

const index = ({ title, questions, rawMarkdownBody }: Props) => {
const index = ({ title, gettingStartedQuestions, generalQuestions, bestPracticesQuestions, specificationQuestions, frontendQuestions, rawMarkdownBody }: Props) => {
return (
<section>
<div className="documentationContent">
<div className="inner-content">
<h1>{title}</h1>
{questions && (
{gettingStartedQuestions && (
<div>
{questions
<h2>Getting Started</h2>
{gettingStartedQuestions
.split(',')
.map(question => (
<Link className="faq-questions" key={question} to={`#${toSlug( question )}`}>
{question}
.map(gettingStartedQuestion => (
<Link className="faq-questions" key={gettingStartedQuestion} to={`#${toSlug( gettingStartedQuestion )}`}>
{gettingStartedQuestion}
</Link>
))
}
</div>
)}
{generalQuestions && (
<div>
<h2>General</h2>
{generalQuestions
.split(',')
.map(generalQuestion => (
<Link className="faq-questions" key={generalQuestion} to={`#${toSlug( generalQuestion )}`}>
{generalQuestion}
</Link>
))
}
</div>
)}
{bestPracticesQuestions && (
<div>
<h2>Best Practices</h2>
{bestPracticesQuestions
.split(',')
.map(bestPracticesQuestion => (
<Link className="faq-questions" key={bestPracticesQuestion} to={`#${toSlug( bestPracticesQuestion )}`}>
{bestPracticesQuestion}
</Link>
))
}
</div>
)}
{specificationQuestions && (
<div>
<h2>Specification</h2>
{specificationQuestions
.split(',')
.map(specificationQuestion => (
<Link className="faq-questions" key={specificationQuestion} to={`#${toSlug( specificationQuestion )}`}>
{specificationQuestion}
</Link>
))
}
</div>
)}
{frontendQuestions && (
<div>
<h2>Frontend</h2>
{frontendQuestions
.split(',')
.map(frontendQuestion => (
<Link className="faq-questions" key={frontendQuestion} to={`#${toSlug( frontendQuestion )}`}>
{frontendQuestion}
</Link>
))
}
Expand Down
Loading