|
1 | 1 | import { clsx } from "clsx" |
2 | 2 |
|
3 | 3 | 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" |
4 | 6 |
|
5 | 7 | export function CommonQuestionsSection( |
6 | 8 | props: React.HTMLAttributes<HTMLDivElement>, |
7 | 9 | ) { |
8 | 10 | return ( |
9 | 11 | <section |
10 | 12 | {...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 | + )} |
12 | 17 | > |
13 | 18 | <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> |
14 | 42 | </section> |
15 | 43 | ) |
16 | 44 | } |
| 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 | +} |
0 commit comments