File tree Expand file tree Collapse file tree 5 files changed +6
-3
lines changed
Expand file tree Collapse file tree 5 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 11import { LearnPagePath } from "@/components/learn-aggregator/learn-pages"
22import { Kind , Topic } from "@/resources/types"
33
4+ // TODO: If the pages need to be customized further, consider flattening [category]/page.tsx
5+ // into multiple page files and defining the following texts in usual JSX.
46export const categoriesConfig : CategoriesConfig = {
57 frontend : {
68 heading : "Frontend" ,
Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ function TopicsFilter({
197197 ) }
198198 onKeyDown = { arrowsMoveSideways }
199199 >
200- < Tag color = { tagColors [ topic ] } >
200+ < Tag color = { tagColors [ topic as keyof typeof tagColors ] } >
201201 { topic . replaceAll ( "-" , " " ) } ({ count } )
202202 </ Tag >
203203 </ button >
Original file line number Diff line number Diff line change 1+
12export const tagColors = {
23 newsletter : "#FFCCEF" ,
34 announcements : "#F80" ,
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ export function BlogTags({
1919 return (
2020 < span className = { clsx ( "flex gap-2" , className ) } >
2121 { tags . map ( tag => {
22- const color = tagColors [ tag ]
22+ const color = tagColors [ tag as keyof typeof tagColors ]
2323 if ( ! color && process . env . NODE_ENV !== "production" ) {
2424 throw new Error ( `No color found for tag: ${ tag } ` )
2525 }
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ export function BlogPage({
7171 className = "-m-1 flex p-1 ring-inset ring-neu-400 transition-opacity duration-75 hover:ring focus:!outline-offset-0 dark:ring-neu-50 [:has(>:hover)>&:not(:hover)]:opacity-70"
7272 onKeyDown = { arrowsMoveSideways }
7373 >
74- < Tag color = { tagColors [ tag ] } >
74+ < Tag color = { tagColors [ tag as keyof typeof tagColors ] } >
7575 { tag . replaceAll ( "-" , " " ) } ({ count } )
7676 </ Tag >
7777 </ NextLink >
You can’t perform that action at this time.
0 commit comments