diff --git a/src/App.jsx b/src/App.jsx index 2406af5..bbc0c28 100755 --- a/src/App.jsx +++ b/src/App.jsx @@ -5,6 +5,7 @@ import LoginModal from "./Components/UI/LoginModal"; import { lightTheme, darkTheme } from "./Style/theme"; import Logo from './assets/images/logo.svg?react'; import { checkAuth } from "./Components/UI/auth"; +import axios from "axios"; function App() { const [authState, setAuthState] = useState({ diff --git a/src/Components/Layout/Dashboard.jsx b/src/Components/Layout/Dashboard.jsx index 48ac303..baf6004 100755 --- a/src/Components/Layout/Dashboard.jsx +++ b/src/Components/Layout/Dashboard.jsx @@ -8,9 +8,9 @@ import useSidebarResize from "../hooks/useSidebarResize"; import TabContent from "../hooks/TabContent"; import menuData from "../TreeChart/menuData.json"; import SidebarMenuWrapper from "./SidebarMenuWrapper"; -import MetricTabContent from "./MetricTabContent" +import MetricTabContent from "./MetricTabContent"; +import ProfileMenu from "../UI/ProfileMenu"; -// Стилизованные компоненты const DashboardContainer = styled(Box)(({ theme }) => ({ display: 'flex', height: '100vh', @@ -37,7 +37,7 @@ const Content = styled(Box)(({ theme }) => ({ color: theme.palette.custom.modalText, })); -const Dashboard = ({ isDarkMode, setIsDarkMode, user }) => { +const Dashboard = ({ isDarkMode, setIsDarkMode, user, onLogout }) => { const { tabs, activeTab, handleOpenTab, handleCloseTab, setActiveTab } = useTabs("Главная"); const [tabContent, setTabContent] = useState({}); const [treeData1, setTreeData1] = useState(menuData); @@ -133,6 +133,19 @@ const Dashboard = ({ isDarkMode, setIsDarkMode, user }) => { return ( + + theme.zIndex.tooltip + 10, + pointerEvents: 'auto' + }} + > + + + {/* Сайдбар */} { + const [anchorEl, setAnchorEl] = useState(null); + const open = Boolean(anchorEl); + + const handleOpen = (event) => { + setAnchorEl(event.currentTarget); + }; + + const handleClose = () => { + setAnchorEl(null); + }; + + const handleLogoutClick = () => { + handleClose(); + onLogout(); + }; + + return ( + <> + + + + {user?.login?.[0]?.toUpperCase() || '?'} + + + + + + + {user?.login || 'Неизвестный'} + + + + Выйти + + + + ); +}; + +export default ProfileMenu;