First commit
This commit is contained in:
24
client/src/components/home/layout.js
Normal file
24
client/src/components/home/layout.js
Normal 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;
|
||||
Reference in New Issue
Block a user