From f17d39318c73693469b0551a12dee4f33c7984cb Mon Sep 17 00:00:00 2001 From: goodmice Date: Thu, 2 Dec 2021 15:49:41 +0500 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BA=D0=BD=D0=BE=D0=BF=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=B2=D1=85=D0=BE=D0=B4=D0=B0/=D0=B2=D1=8B=D1=85=D0=BE=D0=B4?= =?UTF-8?q?=D0=B0=20=D1=81=20=D0=B0=D0=B4=D0=BC=D0=B8=D0=BD=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Layout/AdminLayoutPortal.tsx | 4 ++-- src/components/PageHeader.tsx | 10 ++++++---- src/components/UserMenu.tsx | 12 ++++++++++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/components/Layout/AdminLayoutPortal.tsx b/src/components/Layout/AdminLayoutPortal.tsx index f9f60c3..68d33cf 100644 --- a/src/components/Layout/AdminLayoutPortal.tsx +++ b/src/components/Layout/AdminLayoutPortal.tsx @@ -9,9 +9,9 @@ type LayoutPortalProps = { export const AdminLayoutPortal: React.FC = ({title, ...props}) => ( - + diff --git a/src/components/PageHeader.tsx b/src/components/PageHeader.tsx index 5fc2b9d..02dece4 100644 --- a/src/components/PageHeader.tsx +++ b/src/components/PageHeader.tsx @@ -5,19 +5,21 @@ import { UserMenu } from './UserMenu' import logo from '../images/logo_32.png' type PageHeaderProps = { - children?: React.ReactNode title?: string + isAdmin?: boolean + children?: React.ReactNode + [other: string]: any } -export const PageHeader: React.FC = ({ children, title = 'Мониторинг' }) => ( +export const PageHeader: React.FC = ({ title = 'Мониторинг', isAdmin, children, ...other }) => ( - + {'АСБ'} {children}

{title}

- +
) diff --git a/src/components/UserMenu.tsx b/src/components/UserMenu.tsx index 4ba4188..1e8ab67 100644 --- a/src/components/UserMenu.tsx +++ b/src/components/UserMenu.tsx @@ -16,7 +16,11 @@ const handleLogout = () => { const formLayout: FormProps = { labelCol: { span: 11 }, wrapperCol: { span: 16 } } -export const UserMenu: React.FC = () => { +type UserMenuProps = { + isAdmin?: boolean +} + +export const UserMenu: React.FC = ({ isAdmin }) => { const [form] = useForm() const [isModalVisible, setIsModalVisible] = useState(false) const [showLoader, setShowLoader] = useState(false) @@ -50,7 +54,11 @@ export const UserMenu: React.FC = () => { overlay={( - {}}>Панель администратора + {isAdmin ? ( + Вернуться на сайт + ) : ( + Панель администратора + )} Сменить пароль