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 {
text: string;
header?: boolean;
link?: string;
items: SidebarItem[] & {
link: string;
}[]
}
export const docs: Docs = {
sidebar: [
{ text: "Discord Experiments API", header: true },
{
text: "Introduction",
link: "/docs/discord-experiments-api/introduction",
},
{
text: "Experiments",
link: "/docs/discord-experiments-api/experiments",
},
{
text: "Eligible",
link: "/docs/discord-experiments-api/eligible",
},
{
text: "Stats",
link: "/docs/discord-experiments-api/stats",
text: "Discord Experiments API",
items: [
{
text: "Introduction",
link: "/docs/discord-experiments-api/introduction",
},
{
text: "Experiments",
link: "/docs/discord-experiments-api/experiments",
},
{
text: "Eligible",
link: "/docs/discord-experiments-api/eligible",
},
{
text: "Stats",
link: "/docs/discord-experiments-api/stats",
},
],
},
],
};

View file

@ -42,17 +42,20 @@ const getLinkClasses = (link: SidebarItem) => {
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"
>
<ul class="border-l border-dark-300">
<ul>
{
docs.sidebar.map((item) =>
item.header ? (
<li class="mt-4 pl-4 font-semibold text-white">{item.text}</li>
) : (
<li class={getLinkClasses(item)}>
<a href={item.link}>{item.text}</a>
</li>
)
)
docs.sidebar.map(({ text, items }) => (
<>
<li class="mt-4 font-semibold text-white">{text}</li>
<ul class="border-l border-dark-300">
{items.map((item) => (
<li class={getLinkClasses(item)}>
<a href={item.link}>{item.text}</a>
</li>
))}
</ul>
</>
))
}
</ul>
</nav>