-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: TOC layouts and custom tailwind utlity class
- Loading branch information
1 parent
eab1148
commit 4608061
Showing
3 changed files
with
9 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
import { escapeText } from "@/lib/utils"; | ||
import { escapeText } from '@/lib/utils'; | ||
|
||
const TableOfContents = ({ headings }: { headings: string[] }) => { | ||
return ( | ||
<div className="fixed right-10 top-1/2 -translate-y-1/2 flex flex-col gap-4 p-5 border rounded-2xl"> | ||
<div className="fixed right-10 top-1/2 hidden -translate-y-1/2 flex-col gap-4 rounded-2xl border p-5 md:flex"> | ||
<h3 className="font-bold">Table of Contents</h3> | ||
<div className="flex flex-col gap-1"> | ||
{headings.map((heading) => ( | ||
<a className="font-medium underline" href={`#${escapeText(heading)}`}> | ||
<span className="text-primary">#. </span>{heading} | ||
<span className="text-primary">#. </span> | ||
{heading} | ||
</a> | ||
))} | ||
</div> | ||
</div> | ||
) | ||
} | ||
); | ||
}; | ||
|
||
export default TableOfContents; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters