Spaces:
Running
Running
axeronis commited on
Commit ·
e645f21
1
Parent(s): 33256ac
feat: UI styling minimal dark and responsive navigation
Browse files- frontend/app/layout.tsx +6 -6
- frontend/components/Header.tsx +38 -1
- frontend/components/Sidebar.tsx +7 -26
frontend/app/layout.tsx
CHANGED
|
@@ -81,22 +81,22 @@ export default function RootLayout({
|
|
| 81 |
{/* Desktop Header */}
|
| 82 |
<Header />
|
| 83 |
|
| 84 |
-
{/* Mobile Header - FIXED at top */}
|
| 85 |
-
<div className="
|
| 86 |
<MobileHeader />
|
| 87 |
</div>
|
| 88 |
|
| 89 |
-
{/* Main Content - with padding for fixed header (64px) and nav (56px) */}
|
| 90 |
<main className={cn(
|
| 91 |
-
"flex-1 w-full pt-16 pb-14
|
| 92 |
// Disable global scroll on chats page to fix layout issues
|
| 93 |
pathname?.startsWith('/chats') ? "overflow-y-hidden" : "overflow-y-auto"
|
| 94 |
)}>
|
| 95 |
{children}
|
| 96 |
</main>
|
| 97 |
|
| 98 |
-
{/* Mobile Bottom Navigation - FIXED at bottom */}
|
| 99 |
-
<div className="
|
| 100 |
<MobileBottomNav />
|
| 101 |
</div>
|
| 102 |
</div>
|
|
|
|
| 81 |
{/* Desktop Header */}
|
| 82 |
<Header />
|
| 83 |
|
| 84 |
+
{/* Mobile Header - FIXED at top - ONLY for Mobile (< md) */}
|
| 85 |
+
<div className="md:hidden fixed top-0 left-0 right-0 z-[60]">
|
| 86 |
<MobileHeader />
|
| 87 |
</div>
|
| 88 |
|
| 89 |
+
{/* Main Content - with padding for fixed header (64px) and nav (56px) on Mobile */}
|
| 90 |
<main className={cn(
|
| 91 |
+
"flex-1 w-full pt-16 pb-14 md:pt-0 md:pb-0 overflow-x-hidden",
|
| 92 |
// Disable global scroll on chats page to fix layout issues
|
| 93 |
pathname?.startsWith('/chats') ? "overflow-y-hidden" : "overflow-y-auto"
|
| 94 |
)}>
|
| 95 |
{children}
|
| 96 |
</main>
|
| 97 |
|
| 98 |
+
{/* Mobile Bottom Navigation - FIXED at bottom - ONLY for Mobile (< md) */}
|
| 99 |
+
<div className="md:hidden fixed bottom-0 left-0 right-0 z-40">
|
| 100 |
<MobileBottomNav />
|
| 101 |
</div>
|
| 102 |
</div>
|
frontend/components/Header.tsx
CHANGED
|
@@ -9,6 +9,14 @@ import Link from 'next/link'
|
|
| 9 |
import { LanguageSwitcher } from './LanguageSwitcher'
|
| 10 |
import { useTranslation } from '@/lib/i18n'
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
export function Header() {
|
| 13 |
const { user, logout } = useAuth()
|
| 14 |
const { t } = useTranslation()
|
|
@@ -55,8 +63,37 @@ export function Header() {
|
|
| 55 |
}
|
| 56 |
|
| 57 |
return (
|
| 58 |
-
<header className="hidden
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
<div className="flex items-center gap-4">
|
|
|
|
| 60 |
|
| 61 |
{/* User Profile with Dropdown */}
|
| 62 |
<div className="relative">
|
|
|
|
| 9 |
import { LanguageSwitcher } from './LanguageSwitcher'
|
| 10 |
import { useTranslation } from '@/lib/i18n'
|
| 11 |
|
| 12 |
+
// Main Nav Items (Same as sidebar)
|
| 13 |
+
const navItems = [
|
| 14 |
+
{ href: '/dashboard', labelKey: 'nav.analytics', label: 'Аналитика' },
|
| 15 |
+
{ href: '/chats', labelKey: 'nav.chats', label: 'Чаты' },
|
| 16 |
+
{ href: '/appointments', labelKey: 'nav.appointments', label: 'Записи' },
|
| 17 |
+
{ href: '/settings/brain', labelKey: 'nav.settings', label: 'Настройки' }, // Shortcut to settings
|
| 18 |
+
]
|
| 19 |
+
|
| 20 |
export function Header() {
|
| 21 |
const { user, logout } = useAuth()
|
| 22 |
const { t } = useTranslation()
|
|
|
|
| 63 |
}
|
| 64 |
|
| 65 |
return (
|
| 66 |
+
<header className="hidden md:flex h-16 border-b border-white/10 bg-[#050510] items-center justify-between px-6 sticky top-0 z-30">
|
| 67 |
+
{/* Left: Logo (Visible only when sidebar is hidden i.e. < lg) */}
|
| 68 |
+
<div className="flex items-center gap-2 lg:hidden">
|
| 69 |
+
<Link href="/dashboard" className="flex items-center gap-2">
|
| 70 |
+
<div className="w-8 h-8 relative">
|
| 71 |
+
<img src="/logo-v2.png" alt="Logo" className="w-full h-full object-contain" />
|
| 72 |
+
</div>
|
| 73 |
+
<span className="font-bold text-lg text-white tracking-widest uppercase">
|
| 74 |
+
MicroFunnel
|
| 75 |
+
</span>
|
| 76 |
+
</Link>
|
| 77 |
+
</div>
|
| 78 |
+
|
| 79 |
+
{/* Center: Navigation Links (Visible only on Tablet/Small Desktop: md to lg) */}
|
| 80 |
+
<nav className="hidden md:flex lg:hidden items-center gap-6 absolute left-1/2 -translate-x-1/2">
|
| 81 |
+
{navItems.map((item) => (
|
| 82 |
+
<Link
|
| 83 |
+
key={item.href}
|
| 84 |
+
href={item.href}
|
| 85 |
+
className="text-sm font-medium text-slate-400 hover:text-white transition-colors"
|
| 86 |
+
>
|
| 87 |
+
{t(item.labelKey) || item.label}
|
| 88 |
+
</Link>
|
| 89 |
+
))}
|
| 90 |
+
</nav>
|
| 91 |
+
|
| 92 |
+
{/* Spacer for LG screens where Nav is in Sidebar, to keep Profile on right */}
|
| 93 |
+
<div className="hidden lg:block flex-1" />
|
| 94 |
+
|
| 95 |
<div className="flex items-center gap-4">
|
| 96 |
+
{/* Language Switcher moved here if needed, or kept in profile */}
|
| 97 |
|
| 98 |
{/* User Profile with Dropdown */}
|
| 99 |
<div className="relative">
|
frontend/components/Sidebar.tsx
CHANGED
|
@@ -146,35 +146,16 @@ export function Sidebar() {
|
|
| 146 |
initial="hidden"
|
| 147 |
animate="visible"
|
| 148 |
variants={sidebarVariants}
|
| 149 |
-
className="w-72 flex flex-col relative shrink-0 h-screen sticky top-0 pb-14 lg:pb-0 border-r border-white/10 z-20"
|
| 150 |
-
style={{
|
| 151 |
-
background: 'linear-gradient(135deg, rgba(19, 17, 28, 0.4) 0%, rgba(30, 27, 75, 0.2) 100%)',
|
| 152 |
-
backdropFilter: 'blur(16px)',
|
| 153 |
-
WebkitBackdropFilter: 'blur(16px)',
|
| 154 |
-
boxShadow: '0 4px 30px rgba(0, 0, 0, 0.1)',
|
| 155 |
-
borderRight: '1px solid rgba(255, 255, 255, 0.05)'
|
| 156 |
-
}}
|
| 157 |
>
|
| 158 |
-
{/*
|
| 159 |
-
<div className="
|
| 160 |
-
<div className="absolute top-[-10%] left-[-10%] w-[50%] h-[30%] rounded-full bg-indigo-500/10 blur-[80px]" />
|
| 161 |
-
<div className="absolute bottom-[20%] right-[-10%] w-[50%] h-[40%] rounded-full bg-purple-600/10 blur-[90px]" />
|
| 162 |
-
</div>
|
| 163 |
-
|
| 164 |
-
{/* Logo Section - Hidden on Mobile (already in main header) */}
|
| 165 |
-
<div className="hidden lg:block p-6 relative z-50">
|
| 166 |
<Link href="/dashboard" className="flex items-center gap-3 group">
|
| 167 |
-
<div className="w-
|
| 168 |
-
<
|
| 169 |
-
<img src="/logo-v2.png" alt="MicroFunnel Logo" className="w-full h-full object-contain relative z-10 drop-shadow-lg" />
|
| 170 |
</div>
|
| 171 |
-
<h1 className="text-
|
| 172 |
-
|
| 173 |
-
MicroFunnel
|
| 174 |
-
</span>
|
| 175 |
-
<span className="bg-gradient-to-r from-indigo-400 via-purple-400 to-pink-400 bg-clip-text text-transparent">
|
| 176 |
-
MicroFunnel
|
| 177 |
-
</span>
|
| 178 |
</h1>
|
| 179 |
</Link>
|
| 180 |
</div>
|
|
|
|
| 146 |
initial="hidden"
|
| 147 |
animate="visible"
|
| 148 |
variants={sidebarVariants}
|
| 149 |
+
className="w-72 flex flex-col relative shrink-0 h-screen sticky top-0 pb-14 lg:pb-0 border-r border-white/10 z-20 bg-[#050510]"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
>
|
| 151 |
+
{/* Logo Section */}
|
| 152 |
+
<div className="p-6 relative z-50">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 153 |
<Link href="/dashboard" className="flex items-center gap-3 group">
|
| 154 |
+
<div className="w-8 h-8 flex items-center justify-center relative">
|
| 155 |
+
<img src="/logo-v2.png" alt="MicroFunnel Logo" className="w-full h-full object-contain" />
|
|
|
|
| 156 |
</div>
|
| 157 |
+
<h1 className="text-lg font-bold tracking-widest uppercase text-white">
|
| 158 |
+
MicroFunnel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 159 |
</h1>
|
| 160 |
</Link>
|
| 161 |
</div>
|