More update for Vehicle

This commit is contained in:
Yang Li
2025-06-08 18:34:14 -04:00
parent e70fb22ac3
commit f18f213f6b
34 changed files with 1504 additions and 700 deletions

View File

@@ -2,11 +2,12 @@ import { Bell, ChevronDown, PersonCircle } from 'react-bootstrap-icons';
import { Outlet, useLocation, Navigate } from 'react-router-dom';
import { AuthService } from '../../services';
import SideMenu from './menu';
import { Dropdown } from "react-bootstrap";
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 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");
}
@@ -20,12 +21,21 @@ function Layout() {
<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>
<PersonCircle size={24}/>
<div className="user-info-container me-2">
<div className="user-name">{user && JSON.parse(user)?.username}</div>
<div className="user-role">{user && JSON.parse(user)?.roles[0]}</div>
</div>
<Dropdown>
<Dropdown.Toggle variant="tertiary" id="user-basic">
{/* <ChevronDown size={12} color="#555"></ChevronDown> */}
</Dropdown.Toggle>
<Dropdown.Menu>
<Dropdown.Item className="small-dropdown-item" onClick={() => AuthService.logout()}>Logout</Dropdown.Item>
</Dropdown.Menu>
</Dropdown>
</div>
</div>