1- import styled from 'styled-components' ;
21import { useRouter } from 'next/router' ;
32import { useEffect } from 'react' ;
43import {
@@ -9,22 +8,20 @@ import {
98import useStickyHeader from 'lib/helpers/useStickyHeader' ;
109import NavItem from '../NavItem' ;
1110import ProjectNavigationSidebar from '../ProjectNavigationSidebar' ;
11+ import SideMap from '../SideMap' ;
12+ import {
13+ StyledAside ,
14+ StyledNav ,
15+ StyledUpperSection ,
16+ StyledLowerSection ,
17+ } from '../NavigationSidebar.styles' ;
1218
13- const StyledAside = styled . aside `
14- min-height: 100%;
15- ` ;
16-
17- const StyledNav = styled . nav < { $offset : number } > `
18- position: sticky;
19- top: ${ ( { $offset } ) => `${ $offset + 140 } px` } ;
20- ` ;
21-
22- const StyledUpperSection = styled . section `
23- border-bottom: 1px solid #d6d6d6;
24- color: ${ ( props ) => props . theme . color . navigationBlue } ;
25- ` ;
26-
27- const NavigationSidebar = ( { query = null } ) => {
19+ const NavigationSidebar = ( {
20+ mapData = null ,
21+ isMapExpanded = null ,
22+ setIsMapExpanded = null ,
23+ query = null ,
24+ } ) => {
2825 const router = useRouter ( ) ;
2926 const { extraOffset } = useStickyHeader ( ) ;
3027 const { asPath } = router ;
@@ -40,18 +37,17 @@ const NavigationSidebar = ({ query = null }) => {
4037 return (
4138 < StyledAside >
4239 < StyledNav $offset = { extraOffset } >
40+ < StyledUpperSection >
4341 { /* Project Navigation Components - always show when query is available */ }
4442 { query && < ProjectNavigationSidebar query = { query } /> }
45-
46- < StyledUpperSection >
4743 < NavItem
4844 currentPath = { asPath }
4945 href = "/analyst/dashboard"
5046 icon = { faChevronLeft }
5147 label = "Dashboard"
5248 />
5349 </ StyledUpperSection >
54- < section >
50+ < StyledLowerSection >
5551 < NavItem
5652 currentPath = { asPath }
5753 href = { `/analyst/cbc/${ cbcId } ` }
@@ -64,7 +60,14 @@ const NavigationSidebar = ({ query = null }) => {
6460 icon = { faClockRotateLeft }
6561 label = "History"
6662 />
67- </ section >
63+ </ StyledLowerSection >
64+ { mapData && (
65+ < SideMap
66+ mapData = { mapData }
67+ isMapExpanded = { isMapExpanded }
68+ setIsMapExpanded = { setIsMapExpanded }
69+ />
70+ ) }
6871 </ StyledNav >
6972 </ StyledAside >
7073 ) ;
0 commit comments