11"use client" ;
22import React from "react" ;
33import { Box } from "@mui/material" ;
4- import {
5- OIDCSecure ,
6- Dashboard ,
7- } from "@dirac-grid/diracx-web-components/components" ;
8- import {
9- ApplicationsProvider ,
10- DiracXWebProviders ,
11- } from "@dirac-grid/diracx-web-components/contexts" ;
4+ import { Dashboard } from "@dirac-grid/diracx-web-components/components" ;
5+ import { DiracXWebProviders } from "@dirac-grid/diracx-web-components/contexts" ;
126import { usePathname , useRouter , useSearchParams } from "next/navigation" ;
13- import { applicationList } from "@/gubbins/ApplicationList " ;
7+ import { applicationList } from "@/gubbins/applicationList " ;
148import { defaultSections } from "@/gubbins/DefaultUserDashboard" ;
159
1610// Layout for the dashboard: setup the providers and the dashboard for the applications
@@ -32,32 +26,25 @@ export default function DashboardLayout({
3226 getPath = { ( ) => pathname }
3327 setPath = { router . push }
3428 getSearchParams = { ( ) => searchParams }
29+ // You can optionally pass a list of applications and a default user dashboard
30+ appList = { applicationList }
31+ defaultUserDashboard = { defaultSections }
3532 >
36- { /* ApplicationsProvider is the provider for the applications, you can give it customized application list or default user dashboard to override them.
37- No need to use it if you don't want to customize the applications */ }
38- < ApplicationsProvider
39- appList = { applicationList }
40- defaultUserDashboard = { defaultSections }
41- >
42- { /* OIDCSecure is used to make sure the user is authenticated before accessing the dashboard */ }
43- < OIDCSecure >
44- { /* Dashboard is the main layout for the applications, you can optionally give it a custom logo URL and a drawer width */ }
45- < Dashboard logoURL = { customLogoURL } drawerWidth = { 250 } >
46- < Box
47- sx = { {
48- ml : "1%" ,
49- mr : "1%" ,
50- display : "flex" ,
51- flexDirection : "column" ,
52- flexGrow : 1 ,
53- overflow : "hidden" ,
54- } }
55- >
56- { children }
57- </ Box >
58- </ Dashboard >
59- </ OIDCSecure >
60- </ ApplicationsProvider >
33+ { /* Dashboard is the main layout for the applications, you can optionally give it a custom logo URL and a drawer width */ }
34+ < Dashboard logoURL = { customLogoURL } drawerWidth = { 250 } >
35+ < Box
36+ sx = { {
37+ ml : "1%" ,
38+ mr : "1%" ,
39+ display : "flex" ,
40+ flexDirection : "column" ,
41+ flexGrow : 1 ,
42+ overflow : "hidden" ,
43+ } }
44+ >
45+ { children }
46+ </ Box >
47+ </ Dashboard >
6148 </ DiracXWebProviders >
6249 ) ;
6350}
0 commit comments