diff --git a/src/Components/AppShell/NavBar.tsx b/src/Components/AppShell/NavBar.tsx index df0c1e10..c24e9394 100644 --- a/src/Components/AppShell/NavBar.tsx +++ b/src/Components/AppShell/NavBar.tsx @@ -1,5 +1,5 @@ import { useAuth } from "../Auth" -import { Link } from "react-router-dom"; +import { Link, useLocation } from "react-router-dom"; import { toast } from "react-toastify"; import QuestionMarkIcon from '@heroicons/react/24/outline/QuestionMarkCircleIcon' import { useEffect, useRef, useState } from "react"; @@ -31,6 +31,16 @@ export default function NavBar({ appName}: { appName: string }) { nameRef && setNameWidth(nameRef.current.scrollWidth) }, [nameRef, appName]) + const location = useLocation(); + + const [showNav, setShowNav] = useState(true) + + + useEffect(() => { + let params = new URLSearchParams(location.search); + let embedded = params.get("embedded"); + embedded=="true" && setShowNav(false) + }, [location]); const onLogout = () => { @@ -53,7 +63,7 @@ export default function NavBar({ appName}: { appName: string }) { }); } - return ( + if(showNav) return ( <>