Skip to content

Commit

Permalink
Add profile pictures to table of contents
Browse files Browse the repository at this point in the history
  • Loading branch information
UnsignedArduino committed Oct 22, 2024
1 parent 63139fd commit e67b3ab
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Extension } from "@/scripts/FetchListsFromCMS/types";
import React from "react";
import Link from "next/link";
import { smoothScrollHash } from "@/components/Linkable/Header";
import { AvatarImageRenderer } from "@/components/Blog/Elements";

export function ExtensionTableOfContents({
list,
Expand All @@ -13,6 +14,10 @@ export function ExtensionTableOfContents({
{list.map((ext) => (
<li key={ext.repo}>
<Link href={`#${ext.repo}`} onClick={smoothScrollHash}>
<AvatarImageRenderer
url={`https://github.com/${ext.author}.png?size=16`}
name={ext.author}
/>{" "}
{ext.repo}
</Link>
</li>
Expand Down
13 changes: 9 additions & 4 deletions src/components/AwesomeArcadeList/Tool/toolTableOfContents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Tool } from "@/scripts/FetchListsFromCMS/types";
import React from "react";
import Link from "next/link";
import { smoothScrollHash } from "@/components/Linkable/Header";
import { AvatarImageRenderer } from "@/components/Blog/Elements";

export function ToolTableOfContents({
list,
Expand All @@ -10,10 +11,14 @@ export function ToolTableOfContents({
}): React.ReactNode {
return (
<ul>
{list.map((ext) => (
<li key={ext.repo}>
<Link href={`#${ext.repo}`} onClick={smoothScrollHash}>
{ext.repo}
{list.map((tool) => (
<li key={tool.repo}>
<Link href={`#${tool.repo}`} onClick={smoothScrollHash}>
<AvatarImageRenderer
url={`https://github.com/${tool.author}.png?size=16`}
name={tool.author}
/>{" "}
{tool.repo}
</Link>
</li>
))}
Expand Down

0 comments on commit e67b3ab

Please sign in to comment.