From ac22af3062efe852023bbc9059b95429d5e605a0 Mon Sep 17 00:00:00 2001 From: Toni Date: Fri, 24 May 2024 10:31:18 +0800 Subject: [PATCH] Tried to add a Root.js to separate the navbar, header, footer from the other route path --- src/components/Root.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/components/Root.js diff --git a/src/components/Root.js b/src/components/Root.js new file mode 100644 index 0000000..d877444 --- /dev/null +++ b/src/components/Root.js @@ -0,0 +1,36 @@ +import { useDisclosure } from "@mantine/hooks"; +import { useLocation } from "react-router-dom"; +import NavBar from './components/NavBar'; +import Header from './components/Header'; +import RouterSwitcher from './components/RouterSwitcher'; +import {AppShell} from '@mantine/core'; + + +export default function Root({ logout }) { + const location = useLocation(); + + const [active, setActive] = useState( + data.findIndex((item) => item.link === location.pathname) + ); + + const [opened, {toggle}] = useDisclosure(); + + return( +
+ +
+ + + + + + + Built by Maritoni V. Benjamin + + +
+ ); +} \ No newline at end of file