docs: 2nd navbar implementation

This commit is contained in:
Arista Indrajaya 2024-03-04 16:37:35 +07:00
parent 4aa09e06da
commit 07ef5b8144
5 changed files with 73 additions and 0 deletions

View File

@ -7,12 +7,14 @@ import HomepagePrimaryFeatures from '../components/HomepagePrimaryFeatures'
import HomepageSecondaryFeatures from '../components/HomepageSecondaryFeatures' import HomepageSecondaryFeatures from '../components/HomepageSecondaryFeatures'
import HomepageTerinaryFeatures from '../components/HomepageTerinaryFeatures' import HomepageTerinaryFeatures from '../components/HomepageTerinaryFeatures'
import { DocSearch } from '@docsearch/react' import { DocSearch } from '@docsearch/react'
import NavbarExtended from '../theme/NavbarExtension'
function HomepageHeader() { function HomepageHeader() {
const { siteConfig } = useDocusaurusContext() const { siteConfig } = useDocusaurusContext()
return ( return (
<header className={clsx(styles.heroBanner)}> <header className={clsx(styles.heroBanner)}>
<NavbarExtended />
<div className="container"> <div className="container">
<Heading as="h1" className={clsx(styles.heroTitle)}> <Heading as="h1" className={clsx(styles.heroTitle)}>
Hello, how can we help? Hello, how can we help?

View File

@ -0,0 +1,25 @@
import React from "react";
import Link from '@docusaurus/Link';
import css from "./NavPageContainer.module.css";
export default function NavPageContainer() {
return (
<div className={css.NavPageContainer}>
<Link to="/guides" className={css.NavPageItem}>
Guide
</Link>
<Link
to="/developer"
className={css.NavPageItem}
>
Developer
</Link>
<Link
to="/api-reference"
className={css.NavPageItem}
>
API Reference
</Link>
</div>
);
}

View File

@ -0,0 +1,14 @@
.NavPageContainer {
margin-right: auto;
display: flex;
align-items: right;
}
.NavPageItem {
margin: 0 30px;
font-size: 16px;
font-weight: normal;
color: #262a2f;
cursor: pointer;
text-decoration: none;
}

View File

@ -0,0 +1,13 @@
import React from "react";
import css from "./index.module.css";
import NavPageContainer from "./NavPageContainer";
export default function NavBar() {
return (
<div className={css.NavBar}>
<NavPageContainer />
</div>
);
}

View File

@ -0,0 +1,19 @@
.NavBar {
height: 3rem; /* Adjust height as needed */
background-color: #fff;
padding: 0.5rem 0.8rem; /* Adjust padding as needed */
display: flex;
align-items: center;
justify-content: space-between; /* Align items to the start and end of the container */
position: fixed; /* Fixed position to keep it on top */
top: 55px; /* Position it at the top */
left: 0; /* Position it at the left */
width: 100%; /* Occupy full width of the viewport */
z-index: 5; /* Ensure it's above other elements */
}
@media screen and (max-width: 768px) {
.NavBar {
display: none; /* Hide the NavBar on mobile devices */
}
}