Skip to content

Commit a5e9e3f

Browse files
committed
Extract both LookingForMore instances to one component
1 parent 695f06e commit a5e9e3f

File tree

5 files changed

+64
-77
lines changed

5 files changed

+64
-77
lines changed

src/components/blog-page/index.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import { Tag } from "@/app/conf/_design-system/tag"
55
import { arrowsMoveSideways } from "@/app/conf/_design-system/utils/arrows-move-sideways"
66
import { StripesDecoration } from "@/app/conf/_design-system/stripes-decoration"
77

8+
import { LookingForMore } from "@/components/looking-for-more"
9+
810
import { blogTagColors } from "./blog-tag-colors"
911
import { BlogCard } from "./blog-card"
10-
import { LookingForMore } from "./looking-for-more"
1112
import { BlogMdxContent } from "./mdx-types"
1213
import { FeaturedBlogPosts } from "./featured-blog-posts"
1314

@@ -87,7 +88,13 @@ export function BlogPage({
8788
)}
8889
</section>
8990
</div>
90-
<LookingForMore />
91+
<LookingForMore
92+
description="Explore learning guides and best practices — or browse for tools, libraries and other resources."
93+
links={[
94+
{ href: "/learn", label: "Learn" },
95+
{ href: "/resources", label: "Resources" },
96+
]}
97+
/>
9198
</div>
9299
</main>
93100
)

src/components/blog-page/looking-for-more.tsx

Lines changed: 0 additions & 36 deletions
This file was deleted.

src/components/learn-aggregator/looking-for-more.tsx

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { clsx } from "clsx"
2+
import { Anchor } from "@/app/conf/_design-system/anchor"
3+
import ArrowDownIcon from "@/app/conf/_design-system/pixelarticons/arrow-down.svg?svgr"
4+
5+
type LinkItem = { href: string; label: string }
6+
7+
interface LookingForMoreProps extends React.HTMLAttributes<HTMLElement> {
8+
description: string
9+
links: [LinkItem, LinkItem]
10+
}
11+
12+
export function LookingForMore({
13+
description,
14+
links,
15+
...props
16+
}: LookingForMoreProps) {
17+
return (
18+
<section
19+
{...props}
20+
className={clsx("gql-container gql-section", props.className)}
21+
>
22+
<div className="mx-auto grid max-w-[1504px] gap-0 bg-pri-dark text-white dark:bg-pri-darker lg:grid-cols-[752px_1fr]">
23+
<div className="flex flex-col justify-between gap-6 border-pri-light p-6 xs:gap-8 xs:p-8 lg:border-r lg:p-16">
24+
<h2 className="typography-h2 text-balance">Looking for more?</h2>
25+
<p className="typography-body-lg max-w-[624px]">{description}</p>
26+
</div>
27+
<div className="flex flex-col">
28+
<Anchor
29+
href={links[0].href}
30+
className="flex items-center justify-between border-y border-pri-light px-6 py-10 hover:bg-white/10 xs:px-8 xs:py-16 lg:border-t-0"
31+
>
32+
<span className="typography-body-lg">{links[0].label}</span>
33+
<ArrowDownIcon className="size-10 shrink-0 -rotate-90 text-pri-light" />
34+
</Anchor>
35+
<Anchor
36+
href={links[1].href}
37+
className="flex items-center justify-between px-6 py-10 hover:bg-white/10 xs:px-8 xs:py-16"
38+
>
39+
<span className="typography-body-lg">{links[1].label}</span>
40+
<ArrowDownIcon className="size-10 shrink-0 -rotate-90 text-pri-light" />
41+
</Anchor>
42+
</div>
43+
</div>
44+
</section>
45+
)
46+
}

src/pages/learn/index.mdx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { LearnHeroStripes } from '../../components/learn-aggregator/learn-hero-s
1111
import { pagesBySection } from '../../components/learn-aggregator/learn-pages'
1212
import { CommonQuestionsSection } from '../../components/learn-aggregator/common-questions'
1313
import { TrainingCoursesSection } from '../../components/learn-aggregator/training-courses'
14-
import { LookingForMore } from "../../components/learn-aggregator/looking-for-more"
14+
import { LookingForMore } from "../../components/looking-for-more"
1515

1616
<NavbarFixed />
1717
<TocHero
@@ -68,4 +68,11 @@ import { LookingForMore } from "../../components/learn-aggregator/looking-for-mo
6868

6969
<CommonQuestionsSection id="faq" />
7070

71-
<LookingForMore />
71+
<LookingForMore
72+
description="Learning is just the beginning. Discover tools and other resources — or connect with the GraphQL community around the world."
73+
links={[
74+
{ href: "/resources", label: "Resources" },
75+
{ href: "/community", label: "Community" },
76+
]}
77+
/>
78+

0 commit comments

Comments
 (0)