@@ -7,34 +7,36 @@ import { useLoading } from "@/store/useLoadingStore";
77import { useProjectsNotFoundStore } from "@/store/useProjectsFoundStore" ;
88import { ErrMsg } from "../ui/ErrMsg" ;
99import SpinnerElm from "../ui/SpinnerElm" ;
10+ import { usePathname } from "next/navigation" ;
1011
1112export default function DashboardContainer ( ) {
1213 const { renderProjects } = useRenderProjects ( ) ;
1314 const { data } = useProjectsData ( ) ;
1415 const { loading } = useLoading ( ) ;
1516 const { projectsNotFound } = useProjectsNotFoundStore ( ) ;
17+ const pathname = usePathname ( ) ;
18+
19+ const isProjectsPage = pathname === "/dashboard/projects" ;
20+
1621 return (
17- < div
18- className = { `h-[80vh] md:h-[88vh] rounded-lg mx-1 md:mx-4 bg-ox-black-1 border border-ox-gray ${ ! renderProjects ? "flex items-center justify-center" : "" } ` }
19- >
20- < div className = { `max-h-full ${ ! loading ? "overflow-y-scroll" : "" } ` } >
21- { renderProjects && (
22+ < div className = { `min-h-[calc(100vh-64px)] ${ isProjectsPage ? "flex items-center justify-center" : "" } ` } >
23+ < div className = { `w-full ${ ! loading ? "h-full" : "" } ` } >
24+ { renderProjects && ! loading && (
2225 < ProjectsContainer projects = { data } > </ ProjectsContainer >
2326 ) }
2427 { loading && (
25- < SpinnerElm text = { "loading cool projects for you..." } > </ SpinnerElm >
26- ) }
27- { projectsNotFound && (
28- < ErrMsg
29- text = {
30- "No projects were found matching the selected filters. Please adjust the filters and try again."
31- }
32- > </ ErrMsg >
28+ < div className = "flex items-center justify-center h-full" >
29+ < SpinnerElm text = { "loading cool projects for you..." } > </ SpinnerElm >
30+ </ div >
3331 ) }
34- { ! renderProjects && ! loading && (
35- < ErrMsg
36- text = { "Click on 'Find Projects' to see the magic." }
37- > </ ErrMsg >
32+ { projectsNotFound && ! loading && (
33+ < div className = "flex items-center justify-center h-full" >
34+ < ErrMsg
35+ text = {
36+ "No projects were found matching the selected filters. Please adjust the filters and try again."
37+ }
38+ > </ ErrMsg >
39+ </ div >
3840 ) }
3941 </ div >
4042 </ div >
0 commit comments