Spaces:
Running
Running
axeronis commited on
Commit ·
913fcae
1
Parent(s): 5b82704
fix: mobile UI - remove header duplicates, fix chat nav, responsive buttons/badges
Browse files
frontend/app/settings/billing/page.tsx
CHANGED
|
@@ -178,9 +178,9 @@ export default function BillingPage() {
|
|
| 178 |
</AnimatePresence>
|
| 179 |
|
| 180 |
{/* Header */}
|
| 181 |
-
<div className="flex items-center justify-between">
|
| 182 |
<div>
|
| 183 |
-
<h1 className="text-3xl font-black text-white tracking-tight uppercase flex items-center gap-3">
|
| 184 |
<span className="bg-clip-text text-transparent bg-gradient-to-r from-indigo-400 to-purple-400">
|
| 185 |
Command Center
|
| 186 |
</span>
|
|
@@ -194,16 +194,16 @@ export default function BillingPage() {
|
|
| 194 |
|
| 195 |
{/* Status Badge */}
|
| 196 |
<div className={cn(
|
| 197 |
-
"px-4 py-2 rounded-lg border flex items-center gap-2 font-bold font-mono text-xs tracking-wider uppercase",
|
| 198 |
data?.subscription_status === 'active'
|
| 199 |
? "bg-emerald-500/10 border-emerald-500/30 text-emerald-400"
|
| 200 |
: "bg-amber-500/10 border-amber-500/30 text-amber-400"
|
| 201 |
)}>
|
| 202 |
<div className={cn(
|
| 203 |
-
"w-2 h-2 rounded-full animate-pulse",
|
| 204 |
data?.subscription_status === 'active' ? "bg-emerald-500" : "bg-amber-500"
|
| 205 |
)} />
|
| 206 |
-
|
| 207 |
</div>
|
| 208 |
</div>
|
| 209 |
|
|
|
|
| 178 |
</AnimatePresence>
|
| 179 |
|
| 180 |
{/* Header */}
|
| 181 |
+
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
| 182 |
<div>
|
| 183 |
+
<h1 className="text-2xl sm:text-3xl font-black text-white tracking-tight uppercase flex items-center gap-3">
|
| 184 |
<span className="bg-clip-text text-transparent bg-gradient-to-r from-indigo-400 to-purple-400">
|
| 185 |
Command Center
|
| 186 |
</span>
|
|
|
|
| 194 |
|
| 195 |
{/* Status Badge */}
|
| 196 |
<div className={cn(
|
| 197 |
+
"px-3 sm:px-4 py-2 rounded-lg border flex items-center gap-2 font-bold font-mono text-xs tracking-wider uppercase w-fit",
|
| 198 |
data?.subscription_status === 'active'
|
| 199 |
? "bg-emerald-500/10 border-emerald-500/30 text-emerald-400"
|
| 200 |
: "bg-amber-500/10 border-amber-500/30 text-amber-400"
|
| 201 |
)}>
|
| 202 |
<div className={cn(
|
| 203 |
+
"w-2 h-2 rounded-full animate-pulse flex-shrink-0",
|
| 204 |
data?.subscription_status === 'active' ? "bg-emerald-500" : "bg-amber-500"
|
| 205 |
)} />
|
| 206 |
+
<span className="whitespace-nowrap">{data?.subscription_status === 'active' ? 'АКТИВЕН' : 'НЕАКТИВЕН'}</span>
|
| 207 |
</div>
|
| 208 |
</div>
|
| 209 |
|
frontend/app/settings/brain/page.tsx
CHANGED
|
@@ -992,7 +992,7 @@ export default function BrainSettingsPage() {
|
|
| 992 |
))}
|
| 993 |
</div>
|
| 994 |
|
| 995 |
-
<div className="flex gap-3">
|
| 996 |
<input
|
| 997 |
type="text"
|
| 998 |
value={newField}
|
|
@@ -1003,7 +1003,7 @@ export default function BrainSettingsPage() {
|
|
| 1003 |
/>
|
| 1004 |
<button
|
| 1005 |
onClick={addCustomField}
|
| 1006 |
-
className="px-6 py-3 bg-indigo-600 hover:bg-indigo-700 text-white rounded-xl font-bold shadow-lg hover:shadow-indigo-500/25 transition-all flex items-center gap-2"
|
| 1007 |
>
|
| 1008 |
<Plus className="w-5 h-5" />
|
| 1009 |
Добавить
|
|
|
|
| 992 |
))}
|
| 993 |
</div>
|
| 994 |
|
| 995 |
+
<div className="flex flex-col sm:flex-row gap-3">
|
| 996 |
<input
|
| 997 |
type="text"
|
| 998 |
value={newField}
|
|
|
|
| 1003 |
/>
|
| 1004 |
<button
|
| 1005 |
onClick={addCustomField}
|
| 1006 |
+
className="px-4 sm:px-6 py-3 bg-indigo-600 hover:bg-indigo-700 text-white rounded-xl font-bold shadow-lg hover:shadow-indigo-500/25 transition-all flex items-center justify-center gap-2"
|
| 1007 |
>
|
| 1008 |
<Plus className="w-5 h-5" />
|
| 1009 |
Добавить
|
frontend/components/MobileBottomNav.tsx
CHANGED
|
@@ -1,64 +1,78 @@
|
|
| 1 |
'use client'
|
| 2 |
|
| 3 |
import Link from 'next/link'
|
| 4 |
-
import { usePathname } from 'next/navigation'
|
| 5 |
import {
|
| 6 |
LayoutDashboard,
|
| 7 |
MessageSquare,
|
| 8 |
Calendar,
|
| 9 |
-
Menu
|
| 10 |
-
X
|
| 11 |
} from 'lucide-react'
|
| 12 |
-
import { useState } from 'react'
|
| 13 |
import { cn } from '@/lib/utils'
|
| 14 |
-
import { useTranslation } from '@/lib/i18n'
|
| 15 |
-
|
| 16 |
-
const navItems = [
|
| 17 |
-
{ href: '/dashboard', icon: LayoutDashboard, label: 'Главная' },
|
| 18 |
-
{ href: '/chats', icon: MessageSquare, label: 'Чаты' },
|
| 19 |
-
{ href: '/appointments', icon: Calendar, label: 'Записи' },
|
| 20 |
-
]
|
| 21 |
|
| 22 |
export function MobileBottomNav() {
|
| 23 |
const pathname = usePathname()
|
| 24 |
-
const
|
| 25 |
-
const { t } = useTranslation()
|
| 26 |
|
| 27 |
const isActive = (path: string) => pathname === path || pathname.startsWith(path + '/')
|
| 28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
return (
|
| 30 |
<>
|
| 31 |
{/* Bottom Navigation Bar - only on mobile */}
|
| 32 |
<nav className="md:hidden fixed bottom-0 left-0 right-0 z-50 bg-[#0F172A] border-t border-slate-800 safe-area-bottom">
|
| 33 |
<div className="flex items-center justify-around h-16 px-2">
|
| 34 |
-
{
|
| 35 |
-
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
)}>
|
| 54 |
-
{item.label}
|
| 55 |
-
</span>
|
| 56 |
-
{active && (
|
| 57 |
-
<div className="absolute bottom-1 w-1 h-1 bg-indigo-400 rounded-full" />
|
| 58 |
-
)}
|
| 59 |
-
</Link>
|
| 60 |
-
)
|
| 61 |
-
})}
|
| 62 |
|
| 63 |
{/* Menu Button */}
|
| 64 |
<button
|
|
|
|
| 1 |
'use client'
|
| 2 |
|
| 3 |
import Link from 'next/link'
|
| 4 |
+
import { usePathname, useRouter } from 'next/navigation'
|
| 5 |
import {
|
| 6 |
LayoutDashboard,
|
| 7 |
MessageSquare,
|
| 8 |
Calendar,
|
| 9 |
+
Menu
|
|
|
|
| 10 |
} from 'lucide-react'
|
|
|
|
| 11 |
import { cn } from '@/lib/utils'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
export function MobileBottomNav() {
|
| 14 |
const pathname = usePathname()
|
| 15 |
+
const router = useRouter()
|
|
|
|
| 16 |
|
| 17 |
const isActive = (path: string) => pathname === path || pathname.startsWith(path + '/')
|
| 18 |
|
| 19 |
+
const handleChatsClick = () => {
|
| 20 |
+
// Navigate to /chats WITHOUT leadId to show list
|
| 21 |
+
router.push('/chats')
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
return (
|
| 25 |
<>
|
| 26 |
{/* Bottom Navigation Bar - only on mobile */}
|
| 27 |
<nav className="md:hidden fixed bottom-0 left-0 right-0 z-50 bg-[#0F172A] border-t border-slate-800 safe-area-bottom">
|
| 28 |
<div className="flex items-center justify-around h-16 px-2">
|
| 29 |
+
{/* Главная */}
|
| 30 |
+
<Link
|
| 31 |
+
href="/dashboard"
|
| 32 |
+
className={cn(
|
| 33 |
+
"flex flex-col items-center justify-center flex-1 py-2 px-1 rounded-lg transition-all",
|
| 34 |
+
isActive('/dashboard')
|
| 35 |
+
? "text-indigo-400"
|
| 36 |
+
: "text-slate-400 hover:text-slate-200"
|
| 37 |
+
)}
|
| 38 |
+
>
|
| 39 |
+
<LayoutDashboard className={cn("w-6 h-6 mb-1", isActive('/dashboard') && "text-indigo-400")} />
|
| 40 |
+
<span className={cn("text-xs font-medium", isActive('/dashboard') && "text-indigo-400")}>
|
| 41 |
+
Главная
|
| 42 |
+
</span>
|
| 43 |
+
</Link>
|
| 44 |
+
|
| 45 |
+
{/* Чаты - Special: clears leadId */}
|
| 46 |
+
<button
|
| 47 |
+
onClick={handleChatsClick}
|
| 48 |
+
className={cn(
|
| 49 |
+
"flex flex-col items-center justify-center flex-1 py-2 px-1 rounded-lg transition-all",
|
| 50 |
+
isActive('/chats')
|
| 51 |
+
? "text-indigo-400"
|
| 52 |
+
: "text-slate-400 hover:text-slate-200"
|
| 53 |
+
)}
|
| 54 |
+
>
|
| 55 |
+
<MessageSquare className={cn("w-6 h-6 mb-1", isActive('/chats') && "text-indigo-400")} />
|
| 56 |
+
<span className={cn("text-xs font-medium", isActive('/chats') && "text-indigo-400")}>
|
| 57 |
+
Чаты
|
| 58 |
+
</span>
|
| 59 |
+
</button>
|
| 60 |
|
| 61 |
+
{/* Записи */}
|
| 62 |
+
<Link
|
| 63 |
+
href="/appointments"
|
| 64 |
+
className={cn(
|
| 65 |
+
"flex flex-col items-center justify-center flex-1 py-2 px-1 rounded-lg transition-all",
|
| 66 |
+
isActive('/appointments')
|
| 67 |
+
? "text-indigo-400"
|
| 68 |
+
: "text-slate-400 hover:text-slate-200"
|
| 69 |
+
)}
|
| 70 |
+
>
|
| 71 |
+
<Calendar className={cn("w-6 h-6 mb-1", isActive('/appointments') && "text-indigo-400")} />
|
| 72 |
+
<span className={cn("text-xs font-medium", isActive('/appointments') && "text-indigo-400")}>
|
| 73 |
+
Записи
|
| 74 |
+
</span>
|
| 75 |
+
</Link>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
|
| 77 |
{/* Menu Button */}
|
| 78 |
<button
|
frontend/components/MobileNav.tsx
CHANGED
|
@@ -8,31 +8,10 @@ import { useEffect } from 'react'
|
|
| 8 |
import { Shield } from 'lucide-react'
|
| 9 |
import Link from 'next/link'
|
| 10 |
import { useAuth } from '@/contexts/AuthContext'
|
| 11 |
-
import { LanguageSwitcher } from './LanguageSwitcher'
|
| 12 |
-
import { cn } from '@/lib/utils'
|
| 13 |
|
| 14 |
export function MobileHeader({ onOpen }: { onOpen?: () => void }) {
|
| 15 |
const { user } = useAuth()
|
| 16 |
|
| 17 |
-
// Get user initials for avatar
|
| 18 |
-
const getInitials = (name?: string | null, email?: string) => {
|
| 19 |
-
if (name) {
|
| 20 |
-
return name.split(' ').map(n => n[0]).join('').toUpperCase().slice(0, 2)
|
| 21 |
-
}
|
| 22 |
-
if (email) {
|
| 23 |
-
return email.slice(0, 2).toUpperCase()
|
| 24 |
-
}
|
| 25 |
-
return 'U'
|
| 26 |
-
}
|
| 27 |
-
|
| 28 |
-
// Generate random avatar color based on user email
|
| 29 |
-
const getAvatarColor = (email?: string) => {
|
| 30 |
-
if (!email) return 'bg-indigo-600'
|
| 31 |
-
const colors = ['bg-indigo-600', 'bg-purple-600', 'bg-pink-600', 'bg-blue-600']
|
| 32 |
-
const index = email.charCodeAt(0) % colors.length
|
| 33 |
-
return colors[index]
|
| 34 |
-
}
|
| 35 |
-
|
| 36 |
return (
|
| 37 |
<div className="md:hidden flex items-center justify-between p-3 bg-[#0F172A] text-white border-b border-slate-800 sticky top-0 z-40">
|
| 38 |
{/* Logo */}
|
|
@@ -41,22 +20,8 @@ export function MobileHeader({ onOpen }: { onOpen?: () => void }) {
|
|
| 41 |
<span className="font-bold text-sm">MicroFunnel</span>
|
| 42 |
</Link>
|
| 43 |
|
| 44 |
-
{/* Right side:
|
| 45 |
<div className="flex items-center gap-1">
|
| 46 |
-
{/* Language Switcher */}
|
| 47 |
-
<LanguageSwitcher />
|
| 48 |
-
|
| 49 |
-
{/* Profile Avatar */}
|
| 50 |
-
<Link
|
| 51 |
-
href="/settings/billing"
|
| 52 |
-
className={cn(
|
| 53 |
-
"w-8 h-8 rounded-lg flex items-center justify-center text-white font-bold text-xs shadow-lg border border-white/10",
|
| 54 |
-
getAvatarColor(user?.email)
|
| 55 |
-
)}
|
| 56 |
-
>
|
| 57 |
-
{getInitials(user?.full_name, user?.email)}
|
| 58 |
-
</Link>
|
| 59 |
-
|
| 60 |
{/* Admin Button */}
|
| 61 |
{(user?.is_superuser || user?.role === 'admin') && (
|
| 62 |
<Link
|
|
|
|
| 8 |
import { Shield } from 'lucide-react'
|
| 9 |
import Link from 'next/link'
|
| 10 |
import { useAuth } from '@/contexts/AuthContext'
|
|
|
|
|
|
|
| 11 |
|
| 12 |
export function MobileHeader({ onOpen }: { onOpen?: () => void }) {
|
| 13 |
const { user } = useAuth()
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
return (
|
| 16 |
<div className="md:hidden flex items-center justify-between p-3 bg-[#0F172A] text-white border-b border-slate-800 sticky top-0 z-40">
|
| 17 |
{/* Logo */}
|
|
|
|
| 20 |
<span className="font-bold text-sm">MicroFunnel</span>
|
| 21 |
</Link>
|
| 22 |
|
| 23 |
+
{/* Right side: Only Admin + Menu (no duplicates) */}
|
| 24 |
<div className="flex items-center gap-1">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
{/* Admin Button */}
|
| 26 |
{(user?.is_superuser || user?.role === 'admin') && (
|
| 27 |
<Link
|