Skip to content

Commit ab2fd03

Browse files
committed
Restyle how-it-works section
1 parent 9209102 commit ab2fd03

File tree

2 files changed

+34
-35
lines changed

2 files changed

+34
-35
lines changed

public/img/graph-wash.png

-22.6 KB
Binary file not shown.
Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,42 @@
1-
import Link from "next/link"
1+
import { ChevronRight } from "@/app/conf/_design-system/pixelarticons/chevron-right"
2+
import { Button } from "@/app/conf/_design-system/button"
3+
24
import { CodeA, CodeB, CodeC } from "../code-blocks"
3-
import { clsx } from "clsx"
5+
6+
const TRY_IT_OUT_URL = "https://graphql.org/swapi-graphql"
47

58
export function HowItWorks() {
69
return (
7-
<div className="[background:url('/img/graph-wash.png'),#171e26_repeat_center_center] xl:py-20">
8-
<div className="conf-block container">
9-
<section
10-
className={clsx(
11-
"flex flex-wrap items-center justify-center gap-14 max-sm:flex-col",
12-
"[&_h3]:text-2xl [&_h3]:text-white max-lg:[&_h3]:text-center",
13-
"[&_pre]:!bg-transparent [&_pre]:ring-0 [&_pre_span]:text-[--shiki-dark]",
14-
"[&_h3]:font-extralight",
15-
"[&_code]:whitespace-pre-wrap" /* fix scroll on mobile for code-blocks */,
16-
)}
17-
>
18-
<div>
19-
<h3>Describe your data</h3>
20-
<CodeA />
21-
</div>
22-
23-
<div>
24-
<h3>Ask for what you want</h3>
25-
<CodeB />
26-
</div>
10+
<section className="gql-container gql-section xl:py-20">
11+
<span className="mb-6 flex w-[80px] shrink-0 items-center gap-1 self-start whitespace-nowrap font-mono text-sm/none font-normal uppercase text-pri-base">
12+
<ChevronRight className="shrink-0 translate-y-[-0.5px]" />
13+
How it works
14+
</span>
15+
<h2 className="typography-h2 mb-6 lg:mb-16">A GraphQL Query</h2>
16+
<ol className="list-none">
17+
<ListItem text="Describe your data" code={<CodeA />} />
18+
<ListItem text="Ask for what you want" code={<CodeB />} />
19+
<ListItem text="Get predictable results" code={<CodeC />} />
20+
</ol>
2721

28-
<div>
29-
<h3>Get predictable results</h3>
30-
<CodeC />
31-
</div>
32-
</section>
22+
<Button className="mx-auto mt-8 w-fit lg:mt-16" href={TRY_IT_OUT_URL}>
23+
Try it out live
24+
</Button>
25+
</section>
26+
)
27+
}
3328

34-
<Link
35-
className="index-button mx-auto mt-10 block w-fit border-white text-white"
36-
href="/TODO"
37-
>
38-
Try it out live
39-
</Link>
40-
</div>
41-
</div>
29+
function ListItem({
30+
text,
31+
code,
32+
}: {
33+
text: React.ReactNode
34+
code: React.ReactNode
35+
}) {
36+
return (
37+
<li className="typography-body-md pt-4 [counter-increment:list-item] before:typography-body-sm before:mr-2 before:inline-flex before:size-5 before:translate-y-[-0.5px] before:items-center before:justify-center before:bg-neu-200 before:p-1 before:text-neu-800 before:content-[counter(list-item)] lg:pt-6">
38+
{text}
39+
<div className="mt-4 lg:mt-6">{code}</div>
40+
</li>
4241
)
4342
}

0 commit comments

Comments
 (0)