refactor nav files + tiny css fixes
This commit is contained in:
parent
bc01642fa4
commit
cafdf14928
7 changed files with 15 additions and 54 deletions
24
src/components/navigation/sidebars/nav/index.astro
Normal file
24
src/components/navigation/sidebars/nav/index.astro
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
import SidebarWrapper from "./SidebarWrapper.tsx";
|
||||
import RootNav from "./RootNav.astro";
|
||||
|
||||
const url = Astro.url.pathname.split("/");
|
||||
const currentRoute = url[2];
|
||||
const currentModule = url[3];
|
||||
const currentClass = url[4];
|
||||
|
||||
export interface Props {
|
||||
mobile: boolean;
|
||||
}
|
||||
|
||||
const { mobile } = Astro.props;
|
||||
---
|
||||
<aside class=`nav-wrapper${mobile ? "-mobile" : ""}`>
|
||||
{ mobile ? (
|
||||
<SidebarWrapper client:load>
|
||||
<RootNav currentRoute={currentRoute} currentModule={currentModule} currentClass={currentClass}/>
|
||||
</SidebarWrapper>
|
||||
) : (
|
||||
<RootNav currentRoute={currentRoute} currentModule={currentModule} currentClass={currentClass}/>
|
||||
)}
|
||||
</aside>
|
||||
Loading…
Add table
Add a link
Reference in a new issue