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>(
|
const [defaultOpen, setDefaultOpen] = useState<boolean | undefined>(
|
||||||
undefined,
|
undefined,
|
||||||
);
|
);
|
||||||
|
const [isLoaded, setIsLoaded] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const cookieValue = document.cookie
|
const cookieValue = document.cookie
|
||||||
@@ -759,6 +760,7 @@ export default function Page({ children }: Props) {
|
|||||||
?.split("=")[1];
|
?.split("=")[1];
|
||||||
|
|
||||||
setDefaultOpen(cookieValue === undefined ? true : cookieValue === "true");
|
setDefaultOpen(cookieValue === undefined ? true : cookieValue === "true");
|
||||||
|
setIsLoaded(true);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -780,9 +782,9 @@ export default function Page({ children }: Props) {
|
|||||||
pathname,
|
pathname,
|
||||||
);
|
);
|
||||||
|
|
||||||
// const showProjectsButton =
|
if (!isLoaded) {
|
||||||
// currentPath === "/dashboard/projects" &&
|
return <div className="w-full h-screen bg-background" />; // Placeholder mientras se carga
|
||||||
// (auth?.rol === "owner" || user?.canCreateProjects);
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SidebarProvider
|
<SidebarProvider
|
||||||
|
|||||||
Reference in New Issue
Block a user