11import Link from "next/link"
22import { NavbarFixed } from "@/components/navbar/navbar-fixed"
33import { notFound } from "next/navigation"
4+ import { Breadcrumbs } from "@/_design-system/breadcrumbs"
5+ import { clsx } from "clsx"
46
57import { ResourcesHero } from "../resources-hero"
68import { Eyebrow } from "@/_design-system/eyebrow"
79import { ResourceHubCard } from "../resource-hub-card"
810import { readResources } from "@/resources/data"
911import { topics , type ResourceMetadata , type Topic } from "@/resources/types"
10- import { clsx } from "clsx"
1112
1213export const subcategories = [
1314 "blogs-and-newsletters" ,
@@ -21,23 +22,30 @@ type Variant = Subcategory | "all"
2122
2223const topicSet = new Set < Topic > ( topics )
2324
24- const tabs : { label : string ; href : string ; variant : Variant } [ ] = [
25- {
26- label : "All reading resources" ,
27- href : "/resources/reading" ,
28- variant : "all" ,
29- } ,
25+ const tabs : {
26+ label : string
27+ href : string
28+ variant : Variant
29+ color : string
30+ } [ ] = [
3031 {
3132 label : "Blogs & newsletters" ,
3233 href : "/resources/reading/blogs-and-newsletters" ,
3334 variant : "blogs-and-newsletters" ,
35+ color : "hsl(var(--color-pri-base))" ,
3436 } ,
3537 {
3638 label : "Individual posts" ,
3739 href : "/resources/reading/individual-posts" ,
3840 variant : "individual-posts" ,
41+ color : "#FF8800" ,
42+ } ,
43+ {
44+ label : "Books" ,
45+ href : "/resources/reading/books" ,
46+ variant : "books" ,
47+ color : "#00C6AC" ,
3948 } ,
40- { label : "Books" , href : "/resources/reading/books" , variant : "books" } ,
4149]
4250
4351const variants : Record <
@@ -121,62 +129,64 @@ export async function ReadingLibraryPage({ variant }: { variant: Variant }) {
121129 a . title . localeCompare ( b . title , "en" , { sensitivity : "base" } ) ,
122130 )
123131
132+ const activePath = [
133+ {
134+ name : "Home" ,
135+ route : "/" ,
136+ } ,
137+ {
138+ name : "Resource Hub" ,
139+ route : "/resources" ,
140+ } ,
141+ {
142+ name : "Reading Resources Library" ,
143+ route : "/resources/reading" ,
144+ } ,
145+ ] . map ( item => ( {
146+ ...item ,
147+ title : item . name ,
148+ type : "page" ,
149+ children : [ ] ,
150+ frontMatter : { } ,
151+ } ) )
152+
124153 return (
125154 < main className = "gql-all-anchors-focusable" >
126155 < NavbarFixed />
127- < div className = "gql-container pt-6 lg:pt-8" >
156+ < ResourcesHero
157+ heading = "Reading Resources Library"
158+ text = "Grow your GraphQL expertise with a curated selection of articles, blogs, and books that support continuous learning and keep you in sync with the latest developments."
159+ />
160+ < section className = "gql-container gql-section" >
161+ < Breadcrumbs activePath = { activePath } />
128162 < nav
129- aria-label = "Breadcrumb "
130- className = "flex flex-wrap gap-2 text-neu-700 "
163+ className = "mt-6 grid grid-cols-3 divide-x divide-neu-200 border border-neu-200 dark:divide-neu-100 dark:border-neu-100 "
164+ aria-label = "Reading resource types "
131165 >
132- < Link
133- href = "/resources"
134- className = "typography-body-sm underline-offset-2 hover:underline"
135- >
136- Resource Hub
137- </ Link >
138- < span aria-hidden > ›</ span >
139- < Link
140- href = "/resources/reading"
141- className = "typography-body-sm underline-offset-2 hover:underline"
142- >
143- Reading Resources
144- </ Link >
145- < span aria-hidden > ›</ span >
146- < span className = "typography-body-sm text-neu-900" >
147- { config . title }
148- </ span >
149- </ nav >
150- </ div >
151- < ResourcesHero heading = { config . title } text = { config . description } />
152- < nav
153- className = "gql-container mt-6 lg:mt-8"
154- aria-label = "Reading resource types"
155- >
156- < ul className = "flex flex-wrap gap-2" >
157166 { tabs . map ( tab => {
158167 const active = tab . variant === variant
159168 return (
160- < li key = { tab . variant } >
161- < Link
162- href = { tab . href }
163- aria-current = { active ? "page" : undefined }
164- className = { clsx (
165- "typography-body-sm border border-neu-200 px-3 py-2 text-neu-800 hover:bg-neu-50 dark:border-neu-100 dark:hover:bg-neu-50/50" ,
166- active
167- ? "bg-neu-50 font-semibold ring-1 ring-neu-300 dark:ring-neu-100"
168- : "bg-neu-0" ,
169- ) }
170- >
171- { tab . label }
172- </ Link >
173- </ li >
169+ < Link
170+ key = { tab . variant }
171+ href = { tab . href }
172+ aria-current = { active ? "page" : undefined }
173+ style = {
174+ {
175+ "--color" : tab . color ,
176+ } as React . CSSProperties
177+ }
178+ scroll = { false }
179+ className = { clsx (
180+ "typography-body-lg flex h-full flex-col gap-2 bg-neu-0 px-4 py-3 text-left transition hover:bg-neu-50 dark:bg-neu-0/60 dark:hover:bg-neu-50/40" ,
181+ active &&
182+ "bg-[--color] text-neu-0 hover:bg-[hsl(from_var(--color)_h_s_l/.9)]" ,
183+ ) }
184+ >
185+ { tab . label }
186+ </ Link >
174187 )
175188 } ) }
176- </ ul >
177- </ nav >
178-
179- < section className = "gql-container gql-section" >
189+ </ nav >
180190 < ul className = "mt-10 grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3" >
181191 { filtered . map ( resource => (
182192 < li key = { resource . url } >
0 commit comments