Skip to content

Commit ddd32ac

Browse files
Curate new FAQ sections and add more answers (graphql#982)
* Initial design - not pretty * Add missing answers * Fix sentence structure * Apply suggestions from Benjie's code review Co-authored-by: Benjie Gillam <[email protected]> * Apply suggestions from Ivan's code review Co-authored-by: Ivan Goncharov <[email protected]>
1 parent 886fb78 commit ddd32ac

File tree

3 files changed

+188
-21
lines changed

3 files changed

+188
-21
lines changed

src/components/FAQLayout/index.tsx

Lines changed: 64 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,80 @@ import { toSlug } from '../../utils/slug'
55

66
interface Props {
77
title: string
8-
questions: string
8+
gettingStartedQuestions: string
9+
generalQuestions: string
10+
bestPracticesQuestions: string
11+
specificationQuestions: string
12+
frontendQuestions: string
913
rawMarkdownBody: string
1014
}
1115

12-
const index = ({ title, questions, rawMarkdownBody }: Props) => {
16+
const index = ({ title, gettingStartedQuestions, generalQuestions, bestPracticesQuestions, specificationQuestions, frontendQuestions, rawMarkdownBody }: Props) => {
1317
return (
1418
<section>
1519
<div className="documentationContent">
1620
<div className="inner-content">
1721
<h1>{title}</h1>
18-
{questions && (
22+
{gettingStartedQuestions && (
1923
<div>
20-
{questions
24+
<h2>Getting Started</h2>
25+
{gettingStartedQuestions
2126
.split(',')
22-
.map(question => (
23-
<Link className="faq-questions" key={question} to={`#${toSlug( question )}`}>
24-
{question}
27+
.map(gettingStartedQuestion => (
28+
<Link className="faq-questions" key={gettingStartedQuestion} to={`#${toSlug( gettingStartedQuestion )}`}>
29+
{gettingStartedQuestion}
30+
</Link>
31+
))
32+
}
33+
</div>
34+
)}
35+
{generalQuestions && (
36+
<div>
37+
<h2>General</h2>
38+
{generalQuestions
39+
.split(',')
40+
.map(generalQuestion => (
41+
<Link className="faq-questions" key={generalQuestion} to={`#${toSlug( generalQuestion )}`}>
42+
{generalQuestion}
43+
</Link>
44+
))
45+
}
46+
</div>
47+
)}
48+
{bestPracticesQuestions && (
49+
<div>
50+
<h2>Best Practices</h2>
51+
{bestPracticesQuestions
52+
.split(',')
53+
.map(bestPracticesQuestion => (
54+
<Link className="faq-questions" key={bestPracticesQuestion} to={`#${toSlug( bestPracticesQuestion )}`}>
55+
{bestPracticesQuestion}
56+
</Link>
57+
))
58+
}
59+
</div>
60+
)}
61+
{specificationQuestions && (
62+
<div>
63+
<h2>Specification</h2>
64+
{specificationQuestions
65+
.split(',')
66+
.map(specificationQuestion => (
67+
<Link className="faq-questions" key={specificationQuestion} to={`#${toSlug( specificationQuestion )}`}>
68+
{specificationQuestion}
69+
</Link>
70+
))
71+
}
72+
</div>
73+
)}
74+
{frontendQuestions && (
75+
<div>
76+
<h2>Frontend</h2>
77+
{frontendQuestions
78+
.split(',')
79+
.map(frontendQuestion => (
80+
<Link className="faq-questions" key={frontendQuestion} to={`#${toSlug( frontendQuestion )}`}>
81+
{frontendQuestion}
2582
</Link>
2683
))
2784
}

0 commit comments

Comments
 (0)