Add menu and list page style

This commit is contained in:
Yang Li
2025-04-23 16:26:33 -04:00
parent 1d1a5a09bb
commit fb3bd27a15
19 changed files with 629 additions and 257 deletions

View File

@@ -1,3 +1,4 @@
import { Bell, ChevronDown, PersonCircle } from 'react-bootstrap-icons';
import { Outlet, useLocation, Navigate } from 'react-router-dom';
import { AuthService } from '../../services';
import SideMenu from './menu';
@@ -5,6 +6,7 @@ import SideMenu from './menu';
function Layout() {
const location = useLocation();
const showMenu = location.pathname !== '/login' && location.pathname !== '/landing'; // Example: Hide menu on login page
const user = localStorage.getItem('user') || {};
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");
}
@@ -15,6 +17,18 @@ function Layout() {
showMenu && <SideMenu />
}
<div className="app-main-container">
<div className="app-menu-user-profile-container">
<Bell size={16} color="#0066B1"/>
<div className="app-menu-user-profile ms-2">
<PersonCircle size={24}/>
<div className="user-info-container me-2">
<div className="user-name">{JSON.parse(user).username}</div>
<div className="user-role">{JSON.parse(user).roles[0]}</div>
</div>
<ChevronDown size={12} color="#555"></ChevronDown>
</div>
</div>
{localStorage.getItem('user') && localStorage.getItem('token') ? <Outlet /> : <Navigate to="/login" replace />}
</div>
</div>