From c286448f042da4773f6f5768aa4c7ba399d32278 Mon Sep 17 00:00:00 2001 From: veselovnk Date: Fri, 5 Apr 2024 16:04:15 +0300 Subject: [PATCH] MSP-3104 update main layout --- src/components/Layout/index.tsx | 4 ++- src/components/Layout/layout.scss | 8 +++--- src/modules/Header/index.tsx | 18 ++++++++++++++ src/pages/HomePage/index.tsx | 41 ++----------------------------- 4 files changed, 28 insertions(+), 43 deletions(-) create mode 100644 src/modules/Header/index.tsx diff --git a/src/components/Layout/index.tsx b/src/components/Layout/index.tsx index 065a543..a8f4e17 100644 --- a/src/components/Layout/index.tsx +++ b/src/components/Layout/index.tsx @@ -1,5 +1,5 @@ import { ProfileOutlined } from '@ant-design/icons' -import { Layout, Menu, Spin } from 'antd' +import { Divider, Layout, Menu, Spin } from 'antd' import { useEffect, useState } from 'react' import { Navigate, Outlet, useLocation } from 'react-router-dom' @@ -26,6 +26,7 @@ import { PermissionKeys } from '@type/roles.type.ts' import './layout.scss' + const { Content, Sider } = Layout const LayoutComponent = () => { @@ -107,6 +108,7 @@ const LayoutComponent = () => { onCollapse={(value) => setCollapsed(value)} > + setOpenKeys(keys)} openKeys={openKeys} diff --git a/src/components/Layout/layout.scss b/src/components/Layout/layout.scss index fbb467a..3094efe 100644 --- a/src/components/Layout/layout.scss +++ b/src/components/Layout/layout.scss @@ -64,7 +64,7 @@ } .ant-layout-sider { - padding-top: 64px; + padding-top: $basic-padding * 2; } .ant-menu-title-content { @@ -80,12 +80,14 @@ } } } + .user-menu { - padding-top: 20px; - padding-bottom: 100px; + margin-bottom: 100px; + & ul { height: 40px; } + & .ant-menu-submenu-arrow { display: none !important; } diff --git a/src/modules/Header/index.tsx b/src/modules/Header/index.tsx new file mode 100644 index 0000000..c798c16 --- /dev/null +++ b/src/modules/Header/index.tsx @@ -0,0 +1,18 @@ +import { Layout } from 'antd' + +import UserMenu from '@components/UserMenu/UserMenu.tsx' + +import './header.scss' + + +const { Header: AntdHeader } = Layout + +const Header = () => { + return ( + + + + ) +} + +export default Header diff --git a/src/pages/HomePage/index.tsx b/src/pages/HomePage/index.tsx index 8feaa73..7e844ac 100644 --- a/src/pages/HomePage/index.tsx +++ b/src/pages/HomePage/index.tsx @@ -1,42 +1,5 @@ -import { Button, theme } from 'antd' -import { useState } from 'react' - -import { useRole } from '@hooks/useRole.tsx' - -import { PermissionKeys } from '@type/roles.type.ts' - -import Modal from 'src/widgets/Modal' - import './home-page.scss' -const HomePages = () => { - const { hasPermission } = useRole() - const { useToken } = theme - const { token } = useToken() - const [isOpenModal, setIsOpenModal] = useState(false) - - const isPageAvailable = hasPermission(PermissionKeys.user_view) - - return ( -
- {isPageAvailable && ( - - )} -
Проверка шрифтов
- - {isOpenModal && ( - -
modal content
-
- )} - - -
- ) +export default function HomePage() { + return
Добро пожаловать!
} - -export default HomePages