-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #131 from Loxeris/feat_efficient_dashboard
Feat: efficient dashboard
- Loading branch information
Showing
32 changed files
with
1,844 additions
and
238 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
"use client"; | ||
import * as React from "react"; | ||
import CssBaseline from "@mui/material/CssBaseline"; | ||
import { Box } from "@mui/material"; | ||
import { ThemeProvider as MUIThemeProvider } from "@mui/material/styles"; | ||
import { useMUITheme } from "@/hooks/theme"; | ||
import Dashboard from "@/components/layout/Dashboard"; | ||
import ApplicationsProvider from "@/contexts/ApplicationsProvider"; | ||
import { OIDCSecure } from "@/components/layout/OIDCSecure"; | ||
|
||
export default function DashboardLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
const theme = useMUITheme(); | ||
|
||
return ( | ||
<section> | ||
<ApplicationsProvider> | ||
<OIDCSecure> | ||
<Dashboard> | ||
<MUIThemeProvider theme={theme}> | ||
<CssBaseline /> | ||
<Box | ||
sx={{ | ||
ml: "5%", | ||
mr: "5%", | ||
}} | ||
> | ||
{children} | ||
</Box> | ||
</MUIThemeProvider> | ||
</Dashboard> | ||
</OIDCSecure> | ||
</ApplicationsProvider> | ||
</section> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"use client"; | ||
import React from "react"; | ||
import { useSearchParams } from "next/navigation"; | ||
import UserDashboard from "@/components/applications/UserDashboard"; | ||
import { ApplicationsContext } from "@/contexts/ApplicationsProvider"; | ||
import { applicationList } from "@/components/applications/ApplicationList"; | ||
|
||
export default function Page() { | ||
const searchParams = useSearchParams(); | ||
const appId = searchParams.get("appId"); | ||
const [sections] = React.useContext(ApplicationsContext); | ||
|
||
const appType = React.useMemo(() => { | ||
const section = sections.find((section) => | ||
section.items.some((item) => item.id === appId), | ||
); | ||
return section?.items.find((item) => item.id === appId)?.type; | ||
}, [sections, appId]); | ||
|
||
const Component = React.useMemo(() => { | ||
return applicationList.find((app) => app.name === appType)?.component; | ||
}, [appType]); | ||
|
||
return Component ? <Component /> : <UserDashboard />; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.