fix(components/widgets/docs): remove marker from heading

This commit is contained in:
xHyroM 2023-06-04 20:38:44 +02:00
parent 9cd69c442a
commit ab51d7f40d
No known key found for this signature in database
GPG key ID: BE0423F386C436AA
2 changed files with 35 additions and 27 deletions

View file

@ -4,13 +4,16 @@ export interface Docs {
export interface SidebarItem { export interface SidebarItem {
text: string; text: string;
header?: boolean; items: SidebarItem[] & {
link?: string; link: string;
}[]
} }
export const docs: Docs = { export const docs: Docs = {
sidebar: [ sidebar: [
{ text: "Discord Experiments API", header: true }, {
text: "Discord Experiments API",
items: [
{ {
text: "Introduction", text: "Introduction",
link: "/docs/discord-experiments-api/introduction", link: "/docs/discord-experiments-api/introduction",
@ -28,4 +31,6 @@ export const docs: Docs = {
link: "/docs/discord-experiments-api/stats", link: "/docs/discord-experiments-api/stats",
}, },
], ],
},
],
}; };

View file

@ -42,17 +42,20 @@ const getLinkClasses = (link: SidebarItem) => {
aria-labelledby="grid-left" aria-labelledby="grid-left"
class="bg-dark-r w-64 -translate-x-full p-4 transition-transform duration-200 md:visible md:translate-x-0 md:bg-transparent" class="bg-dark-r w-64 -translate-x-full p-4 transition-transform duration-200 md:visible md:translate-x-0 md:bg-transparent"
> >
<ul class="border-l border-dark-300"> <ul>
{ {
docs.sidebar.map((item) => docs.sidebar.map(({ text, items }) => (
item.header ? ( <>
<li class="mt-4 pl-4 font-semibold text-white">{item.text}</li> <li class="mt-4 font-semibold text-white">{text}</li>
) : ( <ul class="border-l border-dark-300">
{items.map((item) => (
<li class={getLinkClasses(item)}> <li class={getLinkClasses(item)}>
<a href={item.link}>{item.text}</a> <a href={item.link}>{item.text}</a>
</li> </li>
) ))}
) </ul>
</>
))
} }
</ul> </ul>
</nav> </nav>