Skip to content

Commit

Permalink
add: api documentation to menu
Browse files Browse the repository at this point in the history
  • Loading branch information
m-benamor committed Sep 27, 2024
1 parent 72dc66c commit b6d97b1
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ const Header = () => {
let $home: HTMLElement;
let $features: HTMLElement;
let $contact: HTMLElement;
let $apiDoc: HTMLElement;

if (typeof document !== 'undefined') {
sections = document.querySelectorAll("section[id]");
$home = document.getElementById('home_');
$features = document.getElementById('features_');
$contact = document.getElementById('contact_');
$apiDoc = document.getElementById('apiDoc_');
window.addEventListener("scroll", navHighlighter);
}

Expand Down Expand Up @@ -67,18 +69,28 @@ const Header = () => {
$home.className = "text-primary dark:text-white"
$features.className = "text-dark hover:text-primary dark:text-white/70 dark:hover:text-white"
$contact.className = "text-dark hover:text-primary dark:text-white/70 dark:hover:text-white"
$apiDoc.className = "text-dark hover:text-primary dark:text-white/70 dark:hover:text-white"
break;
}
case "features": {
$home.className = "text-dark hover:text-primary dark:text-white/70 dark:hover:text-white"
$features.className = "text-primary dark:text-white"
$contact.className = "text-dark hover:text-primary dark:text-white/70 dark:hover:text-white"
$apiDoc.className = "text-dark hover:text-primary dark:text-white/70 dark:hover:text-white"
break;
}
case "contact": {
$home.className = "text-dark hover:text-primary dark:text-white/70 dark:hover:text-white"
$features.className = "text-dark hover:text-primary dark:text-white/70 dark:hover:text-white"
$contact.className = "text-primary dark:text-white"
$apiDoc.className = "text-dark hover:text-primary dark:text-white/70 dark:hover:text-white"
break;
}
case "apiDoc": {
$home.className = "text-dark hover:text-primary dark:text-white/70 dark:hover:text-white"
$features.className = "text-dark hover:text-primary dark:text-white/70 dark:hover:text-white"
$contact.className = "text-dark hover:text-primary dark:text-white/70 dark:hover:text-white"
$apiDoc.className = "text-dark hover:text-primary dark:text-white/70 dark:hover:text-white"
break;
}
default: {
Expand Down Expand Up @@ -168,6 +180,13 @@ const Header = () => {
</ScrollLink>
</li>
))}
<li key={menuData.length} className="group relative">
<Link
id={"apiDoc_"}
href="/api-doc"
className="flex py-2 text-lg lg:mr-0 lg:inline-flex lg:px-0 lg:py-6 transition-transform cursor-pointer"
>API Doc</Link>
</li>
</ul>
</nav>
</div>
Expand Down

0 comments on commit b6d97b1

Please sign in to comment.