From 1d0674956a884c61e2bd2264b56f06de5569eb30 Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Thu, 15 Feb 2024 00:55:08 +0100 Subject: [PATCH] Created the Root.jsx state --- webui/src/states/Root/Root.jsx | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 webui/src/states/Root/Root.jsx diff --git a/webui/src/states/Root/Root.jsx b/webui/src/states/Root/Root.jsx new file mode 100644 index 0000000..eb969ee --- /dev/null +++ b/webui/src/states/Root/Root.jsx @@ -0,0 +1,27 @@ +import {Navigate, Outlet} from "react-router-dom"; +import {TokenContext} from "@/common/contexts/Token"; +import {useContext, useState} from "react"; +import {Box, Toolbar} from "@mui/material"; +import Sidebar from "@/states/Root/components/Sidebar"; +import Header from "@/states/Root/components/Header"; + +export const Root = () => { + + const [mobileOpen, setMobileOpen] = useState(false); + const {tokenValid} = useContext(TokenContext); + + return ( + <> + {tokenValid === false && } + + {tokenValid && +
setMobileOpen(current => !current)} /> + setMobileOpen(current => !current)} /> + + + + + } + + ) +} \ No newline at end of file