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,28 +4,33 @@ 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: "Introduction", text: "Discord Experiments API",
link: "/docs/discord-experiments-api/introduction", items: [
}, {
{ text: "Introduction",
text: "Experiments", link: "/docs/discord-experiments-api/introduction",
link: "/docs/discord-experiments-api/experiments", },
}, {
{ text: "Experiments",
text: "Eligible", link: "/docs/discord-experiments-api/experiments",
link: "/docs/discord-experiments-api/eligible", },
}, {
{ text: "Eligible",
text: "Stats", link: "/docs/discord-experiments-api/eligible",
link: "/docs/discord-experiments-api/stats", },
{
text: "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">
<li class={getLinkClasses(item)}> {items.map((item) => (
<a href={item.link}>{item.text}</a> <li class={getLinkClasses(item)}>
</li> <a href={item.link}>{item.text}</a>
) </li>
) ))}
</ul>
</>
))
} }
</ul> </ul>
</nav> </nav>