Spaces:
Running
Running
axeronis commited on
Commit ·
2efe4ac
1
Parent(s): 0a883f1
fix: Global mobile layout - header/nav in flex flow, no fixed positioning
Browse files- frontend/app/layout.tsx +12 -10
- frontend/components/MobileBottomNav.tsx +47 -50
- frontend/components/MobileNav.tsx +1 -1
frontend/app/layout.tsx
CHANGED
|
@@ -76,22 +76,24 @@ export default function RootLayout({
|
|
| 76 |
</MobileSidebarWrapper>
|
| 77 |
|
| 78 |
{/* Main Content Area Container */}
|
| 79 |
-
<div className="flex-1 flex flex-col h-full min-w-0
|
| 80 |
{/* Desktop Header */}
|
| 81 |
<Header />
|
| 82 |
|
| 83 |
-
{/* Mobile Header -
|
| 84 |
-
<
|
|
|
|
|
|
|
| 85 |
|
| 86 |
-
{/* Scrollable Content -
|
| 87 |
-
<main className="flex-1 overflow-y-auto overflow-x-hidden w-full
|
| 88 |
-
|
| 89 |
-
{children}
|
| 90 |
-
</div>
|
| 91 |
</main>
|
| 92 |
|
| 93 |
-
{/* Mobile Bottom Navigation */}
|
| 94 |
-
<
|
|
|
|
|
|
|
| 95 |
</div>
|
| 96 |
</div>
|
| 97 |
</ProtectedLayout>
|
|
|
|
| 76 |
</MobileSidebarWrapper>
|
| 77 |
|
| 78 |
{/* Main Content Area Container */}
|
| 79 |
+
<div className="flex-1 flex flex-col h-full min-w-0 overflow-hidden">
|
| 80 |
{/* Desktop Header */}
|
| 81 |
<Header />
|
| 82 |
|
| 83 |
+
{/* Mobile Header - in flex flow (not fixed) */}
|
| 84 |
+
<div className="md:hidden flex-shrink-0 bg-[#0F172A] border-b border-slate-800 z-40">
|
| 85 |
+
<MobileHeader />
|
| 86 |
+
</div>
|
| 87 |
|
| 88 |
+
{/* Scrollable Content - takes remaining space */}
|
| 89 |
+
<main className="flex-1 overflow-y-auto overflow-x-hidden w-full">
|
| 90 |
+
{children}
|
|
|
|
|
|
|
| 91 |
</main>
|
| 92 |
|
| 93 |
+
{/* Mobile Bottom Navigation - in flex flow (not fixed) */}
|
| 94 |
+
<div className="md:hidden flex-shrink-0">
|
| 95 |
+
<MobileBottomNav />
|
| 96 |
+
</div>
|
| 97 |
</div>
|
| 98 |
</div>
|
| 99 |
</ProtectedLayout>
|
frontend/components/MobileBottomNav.tsx
CHANGED
|
@@ -21,58 +21,55 @@ export function MobileBottomNav() {
|
|
| 21 |
}
|
| 22 |
|
| 23 |
return (
|
| 24 |
-
<>
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
<
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
<LayoutDashboard className="w-5 h-5" />
|
| 39 |
-
</Link>
|
| 40 |
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
</>
|
| 77 |
)
|
| 78 |
}
|
|
|
|
| 21 |
}
|
| 22 |
|
| 23 |
return (
|
| 24 |
+
<nav className="bg-[#0F172A] border-t border-slate-800/50 safe-area-bottom">
|
| 25 |
+
<div className="flex items-center justify-around h-14 px-4">
|
| 26 |
+
{/* Главная */}
|
| 27 |
+
<Link
|
| 28 |
+
href="/dashboard"
|
| 29 |
+
className={cn(
|
| 30 |
+
"flex flex-col items-center justify-center p-2 rounded-xl transition-all",
|
| 31 |
+
isActive('/dashboard')
|
| 32 |
+
? "text-indigo-400 bg-indigo-500/10"
|
| 33 |
+
: "text-slate-500 active:bg-white/5"
|
| 34 |
+
)}
|
| 35 |
+
>
|
| 36 |
+
<LayoutDashboard className="w-5 h-5" />
|
| 37 |
+
</Link>
|
|
|
|
|
|
|
| 38 |
|
| 39 |
+
{/* Чаты */}
|
| 40 |
+
<button
|
| 41 |
+
onClick={handleChatsClick}
|
| 42 |
+
className={cn(
|
| 43 |
+
"flex flex-col items-center justify-center p-2 rounded-xl transition-all",
|
| 44 |
+
isActive('/chats')
|
| 45 |
+
? "text-indigo-400 bg-indigo-500/10"
|
| 46 |
+
: "text-slate-500 active:bg-white/5"
|
| 47 |
+
)}
|
| 48 |
+
>
|
| 49 |
+
<MessageSquare className="w-5 h-5" />
|
| 50 |
+
</button>
|
| 51 |
|
| 52 |
+
{/* Записи */}
|
| 53 |
+
<Link
|
| 54 |
+
href="/appointments"
|
| 55 |
+
className={cn(
|
| 56 |
+
"flex flex-col items-center justify-center p-2 rounded-xl transition-all",
|
| 57 |
+
isActive('/appointments')
|
| 58 |
+
? "text-indigo-400 bg-indigo-500/10"
|
| 59 |
+
: "text-slate-500 active:bg-white/5"
|
| 60 |
+
)}
|
| 61 |
+
>
|
| 62 |
+
<Calendar className="w-5 h-5" />
|
| 63 |
+
</Link>
|
| 64 |
|
| 65 |
+
{/* Menu */}
|
| 66 |
+
<button
|
| 67 |
+
onClick={() => document.dispatchEvent(new CustomEvent('toggle-mobile-sidebar'))}
|
| 68 |
+
className="flex flex-col items-center justify-center p-2 rounded-xl text-slate-500 active:bg-white/5 transition-all"
|
| 69 |
+
>
|
| 70 |
+
<Menu className="w-5 h-5" />
|
| 71 |
+
</button>
|
| 72 |
+
</div>
|
| 73 |
+
</nav>
|
|
|
|
| 74 |
)
|
| 75 |
}
|
frontend/components/MobileNav.tsx
CHANGED
|
@@ -50,7 +50,7 @@ export function MobileHeader({ onOpen }: { onOpen?: () => void }) {
|
|
| 50 |
const isUnlimited = limitDialogs === null || limitDialogs === undefined
|
| 51 |
|
| 52 |
return (
|
| 53 |
-
<div className="
|
| 54 |
{/* Left: Logo + Usage Badge */}
|
| 55 |
<div className="flex items-center gap-2">
|
| 56 |
<Link href="/dashboard" className="flex items-center gap-2">
|
|
|
|
| 50 |
const isUnlimited = limitDialogs === null || limitDialogs === undefined
|
| 51 |
|
| 52 |
return (
|
| 53 |
+
<div className="flex items-center justify-between p-3 text-white">
|
| 54 |
{/* Left: Logo + Usage Badge */}
|
| 55 |
<div className="flex items-center gap-2">
|
| 56 |
<Link href="/dashboard" className="flex items-center gap-2">
|