docs: 2nd navbar implementation
This commit is contained in:
parent
4aa09e06da
commit
07ef5b8144
@ -7,12 +7,14 @@ import HomepagePrimaryFeatures from '../components/HomepagePrimaryFeatures'
|
||||
import HomepageSecondaryFeatures from '../components/HomepageSecondaryFeatures'
|
||||
import HomepageTerinaryFeatures from '../components/HomepageTerinaryFeatures'
|
||||
import { DocSearch } from '@docsearch/react'
|
||||
import NavbarExtended from '../theme/NavbarExtension'
|
||||
|
||||
function HomepageHeader() {
|
||||
const { siteConfig } = useDocusaurusContext()
|
||||
|
||||
return (
|
||||
<header className={clsx(styles.heroBanner)}>
|
||||
<NavbarExtended />
|
||||
<div className="container">
|
||||
<Heading as="h1" className={clsx(styles.heroTitle)}>
|
||||
Hello, how can we help?
|
||||
|
||||
25
docs/src/theme/NavbarExtension/NavPageContainer.jsx
Normal file
25
docs/src/theme/NavbarExtension/NavPageContainer.jsx
Normal 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>
|
||||
);
|
||||
}
|
||||
14
docs/src/theme/NavbarExtension/NavPageContainer.module.css
Normal file
14
docs/src/theme/NavbarExtension/NavPageContainer.module.css
Normal 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;
|
||||
}
|
||||
13
docs/src/theme/NavbarExtension/index.js
Normal file
13
docs/src/theme/NavbarExtension/index.js
Normal 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>
|
||||
);
|
||||
}
|
||||
19
docs/src/theme/NavbarExtension/index.module.css
Normal file
19
docs/src/theme/NavbarExtension/index.module.css
Normal 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 */
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user