Changes
This commit is contained in:
@@ -29,6 +29,11 @@ const Sidebar = () => {
|
||||
|
||||
const currentPage = navItems.find(item => item.path === location.pathname)?.label || 'Menu';
|
||||
|
||||
// Close mobile menu when route changes
|
||||
useEffect(() => {
|
||||
setIsExpanded(false);
|
||||
}, [location.pathname]);
|
||||
|
||||
// Check if footer is visible within the sidebar
|
||||
useEffect(() => {
|
||||
const checkFooterVisibility = () => {
|
||||
@@ -77,7 +82,7 @@ const Sidebar = () => {
|
||||
</button>
|
||||
|
||||
{/* Desktop Navigation - Always visible */}
|
||||
<nav ref={navRef} className="hidden md:flex flex-col flex-grow p-4 md:p-5">
|
||||
<nav ref={navRef} className="hidden md:flex flex-col flex-grow p-4 md:p-5 overflow-y-auto scrollbar-thin scrollbar-thumb-primary/50 scrollbar-track-transparent">
|
||||
{navItems.map((item, index) => {
|
||||
const isActive = location.pathname === item.path;
|
||||
|
||||
@@ -140,8 +145,9 @@ const Sidebar = () => {
|
||||
>
|
||||
<Link
|
||||
to={item.path}
|
||||
onClick={() => {
|
||||
onClick={(e) => {
|
||||
playSound('click');
|
||||
// Immediately close the menu
|
||||
setIsExpanded(false);
|
||||
}}
|
||||
className={cn(
|
||||
|
||||
@@ -174,7 +174,7 @@ const TerminalCommand = () => {
|
||||
setIsOpen(true);
|
||||
playSound('beep');
|
||||
}}
|
||||
className="fixed bottom-4 right-4 z-[60] p-3 border-2 border-primary bg-background text-primary hover:bg-primary hover:text-background transition-all duration-300 box-glow"
|
||||
className="hidden md:flex fixed bottom-4 right-4 z-[60] p-3 border-2 border-primary bg-background text-primary hover:bg-primary hover:text-background transition-all duration-300 box-glow"
|
||||
title="Open Terminal (` or Ctrl+/)"
|
||||
>
|
||||
<Terminal className="w-5 h-5" />
|
||||
|
||||
Reference in New Issue
Block a user