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 ? ( + Вернуться на сайт + ) : ( + Панель администратора + )} Сменить пароль