Spaces:
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 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 transition-all duration-300 relative">
80
  {/* Desktop Header */}
81
  <Header />
82
 
83
- {/* Mobile Header - fixed at top */}
84
- <MobileHeader />
 
 
85
 
86
- {/* Scrollable Content - mobile: between header (56px) and bottom nav (64px) */}
87
- <main className="flex-1 overflow-y-auto overflow-x-hidden w-full relative pt-14 pb-16 md:pt-0 md:pb-0">
88
- <div className="min-h-full">
89
- {children}
90
- </div>
91
  </main>
92
 
93
- {/* Mobile Bottom Navigation */}
94
- <MobileBottomNav />
 
 
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
- {/* Bottom Navigation Bar - compact design */}
26
- <nav className="md:hidden fixed bottom-0 left-0 right-0 z-50 bg-[#0F172A]/95 backdrop-blur-lg border-t border-slate-800/50 safe-area-bottom">
27
- <div className="flex items-center justify-around h-12 px-4">
28
- {/* Главная */}
29
- <Link
30
- href="/dashboard"
31
- className={cn(
32
- "flex flex-col items-center justify-center p-2 rounded-xl transition-all",
33
- isActive('/dashboard')
34
- ? "text-indigo-400 bg-indigo-500/10"
35
- : "text-slate-500 active:bg-white/5"
36
- )}
37
- >
38
- <LayoutDashboard className="w-5 h-5" />
39
- </Link>
40
 
41
- {/* Чаты */}
42
- <button
43
- onClick={handleChatsClick}
44
- className={cn(
45
- "flex flex-col items-center justify-center p-2 rounded-xl transition-all",
46
- isActive('/chats')
47
- ? "text-indigo-400 bg-indigo-500/10"
48
- : "text-slate-500 active:bg-white/5"
49
- )}
50
- >
51
- <MessageSquare className="w-5 h-5" />
52
- </button>
53
 
54
- {/* Записи */}
55
- <Link
56
- href="/appointments"
57
- className={cn(
58
- "flex flex-col items-center justify-center p-2 rounded-xl transition-all",
59
- isActive('/appointments')
60
- ? "text-indigo-400 bg-indigo-500/10"
61
- : "text-slate-500 active:bg-white/5"
62
- )}
63
- >
64
- <Calendar className="w-5 h-5" />
65
- </Link>
66
 
67
- {/* Menu */}
68
- <button
69
- onClick={() => document.dispatchEvent(new CustomEvent('toggle-mobile-sidebar'))}
70
- className="flex flex-col items-center justify-center p-2 rounded-xl text-slate-500 active:bg-white/5 transition-all"
71
- >
72
- <Menu className="w-5 h-5" />
73
- </button>
74
- </div>
75
- </nav>
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="md:hidden fixed top-0 left-0 right-0 flex items-center justify-between p-3 bg-[#0F172A] text-white border-b border-slate-800 z-40">
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">