Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions frontend/components/layout/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import React from 'react';
import Link from 'next/link';
import { useEffect, useState } from 'react';
import { usePathname } from 'next/navigation';
import {
HomeIcon,
Expand Down Expand Up @@ -59,9 +60,23 @@ const navigation: NavSection[] = [
];

export const Sidebar: React.FC = () => {

// Add state to handle client-side rendering
const [isMounted, setIsMounted] = useState(false);

// Use useEffect to mark component as mounted
useEffect(() => {
setIsMounted(true);
}, []);

const pathname = usePathname();
const { collapsed, toggleSidebar } = useSidebar();

// Return null or loading state until mounted
if (!isMounted) {
return <aside className="fixed left-0 top-0 h-screen w-[280px] bg-white dark:bg-slate border-r border-gray-200 dark:border-slate-light" />;
}

return (
<aside
className={cn(
Expand Down
Loading