From d1e4cc67aa5644d58f070ffc7a188b0cf1622124 Mon Sep 17 00:00:00 2001 From: Kirill Date: Thu, 21 May 2026 20:45:23 +0500 Subject: [PATCH] feat: admin avatar in header with settings link --- client/src/app/layout/AppHeader.tsx | 6 ++---- client/src/features/user/user-menu/ui/UserMenu.tsx | 10 +++++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/client/src/app/layout/AppHeader.tsx b/client/src/app/layout/AppHeader.tsx index 7a0b734..d3c97de 100644 --- a/client/src/app/layout/AppHeader.tsx +++ b/client/src/app/layout/AppHeader.tsx @@ -146,12 +146,10 @@ export function AppHeader() { )} - {!isAdmin && } + {!isAdmin && } {isAdmin && user && !isMobile && ( - + )} {!isMobile && ( diff --git a/client/src/features/user/user-menu/ui/UserMenu.tsx b/client/src/features/user/user-menu/ui/UserMenu.tsx index fe72a6a..f2dbf7b 100644 --- a/client/src/features/user/user-menu/ui/UserMenu.tsx +++ b/client/src/features/user/user-menu/ui/UserMenu.tsx @@ -9,11 +9,12 @@ import { UserAvatar } from '@/shared/ui/UserAvatar' type Props = { user: AuthUser | null + isAdmin?: boolean onNavigate: (to: string) => void onLogout: () => void } -export function UserMenu({ user, onNavigate, onLogout }: Props) { +export function UserMenu({ user, isAdmin = false, onNavigate, onLogout }: Props) { const [anchorEl, setAnchorEl] = useState(null) const open = Boolean(anchorEl) @@ -63,8 +64,11 @@ export function UserMenu({ user, onNavigate, onLogout }: Props) { > {user ? ( <> - go('/me')}> - + go(isAdmin ? '/admin/settings' : '/me')}> + Выход