diff --git a/apps/backoffice/src/app/layouts/BackofficeLayout.tsx b/apps/backoffice/src/app/layouts/BackofficeLayout.tsx index 4ef2a088e..f799c8335 100644 --- a/apps/backoffice/src/app/layouts/BackofficeLayout.tsx +++ b/apps/backoffice/src/app/layouts/BackofficeLayout.tsx @@ -1,11 +1,10 @@ -import { useCallback, useState } from 'react'; -import { AppShell } from '@mantine/core'; +import { useCallback } from 'react'; +import { AppShell, rem } from '@mantine/core'; import { useDisclosure } from '@mantine/hooks'; import { Outlet, useLocation, useNavigate } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { logout } from '@ema-platform/auth'; -import { AppHeader, AppSidebar } from '@ema-platform/ui'; -import type { NavItem } from '@ema-platform/ui'; +import { AppHeader } from '@ema-platform/ui'; import { IconLayoutDashboard, IconUsers, @@ -15,6 +14,14 @@ import { import { notify } from '@ema-platform/ui'; import { SUPPORTED_LANGUAGES } from '../i18n/config'; import { useAppDispatch, useAppSelector } from '../store/hooks'; +import type { Icon } from '@tabler/icons-react'; + +interface NavItem { + label: string; + icon: Icon; + to?: string; + soon?: boolean; +} const NAV_ITEMS: NavItem[] = [ { to: '/dashboard', label: 'Dashboard', icon: IconLayoutDashboard }, @@ -23,14 +30,14 @@ const NAV_ITEMS: NavItem[] = [ { to: '/profile', label: 'Profile', icon: IconUser }, ]; +const HEADER_HEIGHT = 116; + export function BackofficeLayout() { const { t } = useTranslation(); const navigate = useNavigate(); const location = useLocation(); const dispatch = useAppDispatch(); const [opened, { toggle: toggleNav }] = useDisclosure(); - const [collapsed, setCollapsed] = useState(false); - const handleToggleCollapse = () => setCollapsed((prev) => !prev); const user = useAppSelector((state) => state.auth.user); const displayName = user?.name?.en || user?.username || ''; @@ -43,7 +50,6 @@ export function BackofficeLayout() { navigate('/login'); }, [dispatch, navigate]); - // Breadcrumbs const segments = location.pathname.split('/').filter(Boolean); const crumbs = [ { label: t('nav.dashboard'), path: '/dashboard' }, @@ -66,51 +72,89 @@ export function BackofficeLayout() { return ( - + {/* Top bar */} +
+ +
+ + {/* Legacy-style tab bar — matching UM AppMenuTabs look */} +
+ {NAV_ITEMS.map((item) => { + const active = !!item.to && (location.pathname === item.to || location.pathname.startsWith(`${item.to}/`)); + const ItemIcon = item.icon; + return ( + + ); + })} +
- - -