First commit

This commit is contained in:
Yang Li
2025-04-19 17:27:36 -04:00
parent a5190a2448
commit 1d1a5a09bb
43 changed files with 454 additions and 297 deletions

View File

@@ -0,0 +1,24 @@
import { Outlet, useLocation, Navigate } from 'react-router-dom';
import { AuthService } from '../../services';
import SideMenu from './menu';
function Layout() {
const location = useLocation();
const showMenu = location.pathname !== '/login' && location.pathname !== '/landing'; // Example: Hide menu on login page
const getLogoSuffix = () => {
return (window.location.hostname.includes('worldshine2.mayo.llc') || window.location.hostname.includes('site2') || window.location.host.includes('ws2') ||window.location.hostname.includes('localhost')) ? "Care LLC" : ((window.location.hostname.includes('worldshine3.mayo.llc') ||window.location.hostname.includes('site3') || window.location.hostname.includes('ws3')) ? "Cloverleaf LLC" : "International LLC");
}
return (
<div className="app-layout">
{
showMenu && <SideMenu />
}
<div className="app-main-container">
{localStorage.getItem('user') && localStorage.getItem('token') ? <Outlet /> : <Navigate to="/login" replace />}
</div>
</div>
);
}
export default Layout;