11"use client" ;
22
3- import { SidebarProvider , SidebarTrigger } from "@/components/ui/sidebar" ;
4- import { UmbrellaPopoverSelection } from "@/components/umbrella-popover-selection" ;
5- import {
6- Event ,
7- Role ,
8- UmbrellasDocument ,
9- UmbrellasQuery ,
10- UmbrellasQueryVariables ,
11- } from "@/lib/gql/generated/graphql" ;
12- import { getClient } from "@/lib/graphql" ;
13- import { slugify } from "@/lib/utils" ;
14- import { defaultEvent } from "@/types/defaults" ;
15- import { usePathname , useRouter } from "next/navigation" ;
16- import React , { useEffect , useState } from "react" ;
17- import { AdminSidebar } from "./sidebar" ;
18- import { Footer } from "@/components/footer" ;
3+ import { SidebarProvider , SidebarTrigger } from "@/components/ui/sidebar" ;
4+ import { UmbrellaPopoverSelection } from "@/components/umbrella-popover-selection" ;
5+ import { Event , Role , UmbrellasDocument , UmbrellasQuery , UmbrellasQueryVariables , } from "@/lib/gql/generated/graphql" ;
6+ import { getClient } from "@/lib/graphql" ;
7+ import { slugify } from "@/lib/utils" ;
8+ import { defaultEvent } from "@/types/defaults" ;
9+ import { usePathname , useRouter } from "next/navigation" ;
10+ import React , { useEffect , useState } from "react" ;
11+ import { AdminSidebar } from "./sidebar" ;
12+ import { Footer } from "@/components/footer" ;
1913import { useUser } from "@/components/provider/user-provider" ;
2014
2115interface PlannerLayoutProps {
2216 children : React . ReactNode ;
2317}
2418
25- export default function PlannerLayout ( { children } : PlannerLayoutProps ) {
19+ export default function PlannerLayout ( { children} : PlannerLayoutProps ) {
2620 const router = useRouter ( ) ;
2721 const pathname = usePathname ( ) ;
28- const { user } = useUser ( ) ;
22+ const { user} = useUser ( ) ;
2923 const [ umbrellas , setUmbrellas ] = useState < Event [ ] > ( [ ] ) ;
3024
3125 const basePath = "/" + pathname . split ( "/" ) [ 1 ] ;
@@ -49,7 +43,7 @@ export default function PlannerLayout({ children }: PlannerLayoutProps) {
4943 router . push ( "/" + slugify ( umbrella . title ) + "-" + umbrella . ID ) ;
5044 }
5145 setUmbrellas (
52- umbrellaData . umbrellas . map ( ( u ) => ( { ...defaultEvent , ...u , supportingEvents : [ ] } ) )
46+ umbrellaData . umbrellas . map ( ( u ) => ( { ...defaultEvent , ...u , supportingEvents : [ ] } ) )
5347 ) ;
5448 }
5549 } ;
@@ -61,27 +55,31 @@ export default function PlannerLayout({ children }: PlannerLayoutProps) {
6155 < div className = "flex flex-col min-h-[calc(100vh-80px)] mt-[81px] w-full" >
6256 { user ?. role === Role . Admin ? (
6357 < SidebarProvider >
64- < AdminSidebar umbrellas = { umbrellas } />
65- < main className = "flex-1" >
66- < div className = "p-5" >
67- < SidebarTrigger className = "mb-2 block" />
68- { children }
69- </ div >
70- </ main >
58+ < AdminSidebar umbrellas = { umbrellas } />
59+ < div className = { 'flex-1 flex flex-col' } >
60+ < main className = "flex-1" >
61+ < div className = "p-5" >
62+ < SidebarTrigger className = "mb-2 block" />
63+ { children }
64+ </ div >
65+ </ main >
66+ < Footer />
67+ </ div >
7168 </ SidebarProvider >
7269 ) : (
73- < main className = "flex-1 flex flex-col gap-y-5 p-5" >
70+ < >
71+ < main className = "flex-1 flex flex-col gap-y-5 p-5" >
7472 { umbrellas . length > 0 && (
7573 < UmbrellaPopoverSelection
7674 umbrellas = { umbrellas }
7775 className = "text-4xl font-bold"
7876 />
7977 ) }
8078 { children }
81- </ main >
79+ </ main >
80+ < Footer />
81+ </ >
8282 ) }
83-
84- < Footer />
8583 </ div >
8684 ) ;
8785}
0 commit comments