@@ -2,10 +2,9 @@ import React from 'react';
22import { Link , useLocation } from 'react-router-dom' ;
33import { Activity , Github , Info , ChevronLeft , ChevronRight , Menu , X } from 'lucide-react' ;
44
5- const Sidebar = ( { metrics, algorithms, onShowCredits } ) => {
5+ const Sidebar = ( { metrics, algorithms, onShowCredits, isCollapsed , onToggleCollapse } ) => {
66 const location = useLocation ( ) ;
77 const [ openSection , setOpenSection ] = React . useState ( 'algorithms' ) ;
8- const [ isCollapsed , setIsCollapsed ] = React . useState ( false ) ;
98 const [ isMobileMenuOpen , setIsMobileMenuOpen ] = React . useState ( false ) ;
109
1110 // Auto-expand section based on URL
@@ -170,7 +169,7 @@ const Sidebar = ({ metrics, algorithms, onShowCredits }) => {
170169 < aside className = { `hidden md:flex flex-col fixed h-full bg-surface border-r-2 border-black z-10 transition-all duration-300 ${ isCollapsed ? 'w-16' : 'w-64' } ` } >
171170 { /* Collapse/Expand Button */ }
172171 < button
173- onClick = { ( ) => setIsCollapsed ( ! isCollapsed ) }
172+ onClick = { ( ) => onToggleCollapse ( ! isCollapsed ) }
174173 className = "absolute -right-3 top-24 bg-accent-yellow border-2 border-black p-1 shadow-[2px_2px_0px_0px_rgba(0,0,0,1)] hover:shadow-[4px_4px_0px_0px_rgba(0,0,0,1)] hover:-translate-x-0.5 transition-all z-20"
175174 title = { isCollapsed ? 'Expand sidebar' : 'Collapse sidebar' }
176175 >
0 commit comments