Skip to content

Commit 1d4e140

Browse files
committed
Add Common Questions
1 parent aba5142 commit 1d4e140

File tree

4 files changed

+61
-4
lines changed

4 files changed

+61
-4
lines changed
Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,58 @@
11
import { clsx } from "clsx"
22

33
import { Eyebrow } from "@/_design-system/eyebrow"
4+
import ArrowDownIcon from "@/app/conf/_design-system/pixelarticons/arrow-down.svg?svgr"
5+
import { Anchor } from "@/app/conf/_design-system/anchor"
46

57
export function CommonQuestionsSection(
68
props: React.HTMLAttributes<HTMLDivElement>,
79
) {
810
return (
911
<section
1012
{...props}
11-
className={clsx("gql-section gql-container", props.className)}
13+
className={clsx(
14+
"gql-section gql-container grid-rows-[auto_auto_1fr] *:[grid-column:1] lg:grid lg:grid-cols-[1fr_auto]",
15+
props.className,
16+
)}
1217
>
1318
<Eyebrow>FAQ</Eyebrow>
19+
<h2 className="typography-h2 mt-6">Common questions</h2>
20+
<p className="typography-body-md mt-6">
21+
Find answers to the most common questions about GraphQL — from getting
22+
started to advanced use cases. This also covers frontend concerns and
23+
info about the official specification.
24+
</p>
25+
<ul className="row-span-full mt-6 ![grid-column:2] *:border-b *:border-neu-200 dark:*:border-neu-100 lg:w-[380px] xl:w-[496px]">
26+
<CommonQuestionsItem
27+
title="Getting started"
28+
href="/learn/faq#getting-started"
29+
/>
30+
<CommonQuestionsItem title="General" href="/learn/faq#general" />
31+
<CommonQuestionsItem
32+
title="Best practices"
33+
href="/learn/faq#best-practices"
34+
/>
35+
<CommonQuestionsItem
36+
title="Specification"
37+
href="/learn/faq#specification"
38+
/>
39+
<CommonQuestionsItem title="Frontend" href="/learn/faq#frontend" />
40+
<CommonQuestionsItem title="Foundation" href="/learn/faq#foundation" />
41+
</ul>
1442
</section>
1543
)
1644
}
45+
46+
function CommonQuestionsItem({ title, href }: { title: string; href: string }) {
47+
return (
48+
<li className="hover:!border-current">
49+
<Anchor
50+
href={href}
51+
className="typography-body-lg -mx-4 flex items-center justify-between p-4 text-neu-800 hover:text-neu-900 dark:text-neu-700"
52+
>
53+
{title}
54+
<ArrowDownIcon className="size-6 shrink-0 -rotate-90" />
55+
</Anchor>
56+
</li>
57+
)
58+
}

src/components/learn-aggregator/training-courses.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function TrainingCoursesSection(
1111
return (
1212
<section
1313
{...props}
14-
className={clsx("gql-section gql-container", props.className)}
14+
className={clsx("gql-section gql-container lg:pb-24", props.className)}
1515
>
1616
<div className="mx-auto flex max-w-[960px] flex-col items-center">
1717
<Eyebrow>Tutorials</Eyebrow>

src/components/toc-hero/index.tsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,28 @@
1+
import { clsx } from "clsx"
2+
13
export { TocHeroContents } from "./toc-hero-contents"
24

35
export interface TocHeroProps {
46
heading: string
57
text: React.ReactNode
68
children: React.ReactNode
79
decoration: React.ReactNode
10+
className?: string
811
}
9-
export function TocHero({ heading, text, children, decoration }: TocHeroProps) {
12+
export function TocHero({
13+
heading,
14+
text,
15+
children,
16+
decoration,
17+
className,
18+
}: TocHeroProps) {
1019
return (
11-
<section className="relative overflow-visible bg-neu-0 pt-[calc(var(--nextra-navbar-height)+24px)]">
20+
<section
21+
className={clsx(
22+
"relative overflow-visible bg-neu-0 pt-[calc(var(--nextra-navbar-height)+24px)]",
23+
className,
24+
)}
25+
>
1226
{decoration}
1327
<div className="gql-section gql-container relative flex !max-w-screen-lg flex-col items-center gap-6 text-center lg:gap-8 xl:!max-w-screen-xl">
1428
<h1 className="typography-h1">{heading}</h1>

src/pages/learn/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { NavbarFixed } from '../../components/navbar/navbar-fixed'
99

1010
<NavbarFixed />
1111
<TocHero
12+
className="mb-4 lg:mb-8"
1213
heading="Start learning GraphQL"
1314
text={
1415
<>

0 commit comments

Comments
 (0)