Skip to content

Commit 9f9db4b

Browse files
committed
Fix type errors
1 parent 11c210c commit 9f9db4b

File tree

5 files changed

+6
-3
lines changed

5 files changed

+6
-3
lines changed

src/app/(main)/resources/[category]/categories-config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { LearnPagePath } from "@/components/learn-aggregator/learn-pages"
22
import { 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.
46
export const categoriesConfig: CategoriesConfig = {
57
frontend: {
68
heading: "Frontend",

src/app/(main)/resources/video/video-library.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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>

src/app/conf/_design-system/tag-colors.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
export const tagColors = {
23
newsletter: "#FFCCEF",
34
announcements: "#F80",

src/components/blog-page/blog-tags.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

src/components/blog-page/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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>

0 commit comments

Comments
 (0)