mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
feat(ui): add loading state to sidebar layout
This commit is contained in:
@@ -751,6 +751,7 @@ export default function Page({ children }: Props) {
|
||||
const [defaultOpen, setDefaultOpen] = useState<boolean | undefined>(
|
||||
undefined,
|
||||
);
|
||||
const [isLoaded, setIsLoaded] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
const cookieValue = document.cookie
|
||||
@@ -759,6 +760,7 @@ export default function Page({ children }: Props) {
|
||||
?.split("=")[1];
|
||||
|
||||
setDefaultOpen(cookieValue === undefined ? true : cookieValue === "true");
|
||||
setIsLoaded(true);
|
||||
}, []);
|
||||
|
||||
const router = useRouter();
|
||||
@@ -780,9 +782,9 @@ export default function Page({ children }: Props) {
|
||||
pathname,
|
||||
);
|
||||
|
||||
// const showProjectsButton =
|
||||
// currentPath === "/dashboard/projects" &&
|
||||
// (auth?.rol === "owner" || user?.canCreateProjects);
|
||||
if (!isLoaded) {
|
||||
return <div className="w-full h-screen bg-background" />; // Placeholder mientras se carga
|
||||
}
|
||||
|
||||
return (
|
||||
<SidebarProvider
|
||||
|
||||
Reference in New Issue
Block a user