Files
app_umbrix/components/BottomNav.tsx
Umbrix Dev 33b20b979f 🔒 Аудит: безопасность, TypeScript, UI, BottomNav
Безопасность:
- proxy: белый список путей (только /sub/*), POST заблокирован
- console.log заменён на logger (утечки URL/данных)
- OnboardingFlow: убраны --tg-theme-* (не существуют в проекте)

TypeScript (0 ошибок):
- tsconfig target es5→es2017 (regex /u flag fix)
- layout.tsx: viewport перенесён в metadata (Next.js 13.5)
- telegram-webhook: fix text possibly undefined
- hooks/useTelegramWebApp: fix Object possibly undefined
- types/telegram: убрана дублирующая Window декларация

UI:
- BottomNav: новый компонент (Назад/Главная/Помощь)
- safe-area-bottom CSS класс добавлен в globals.css
- dashboard: spacer h-20, toast поднят над BottomNav
- OnboardingFlow: цены 149/249/350₽ (были 200/350/500₽)

Очистка:
- page_NEW.tsx удалён локально (не был в git)
2026-02-08 18:59:02 +03:00

52 lines
1.8 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
'use client';
import { useRouter, usePathname } from 'next/navigation';
import { ChevronLeft, Home, HelpCircle } from 'lucide-react';
export default function BottomNav() {
const router = useRouter();
const pathname = usePathname();
// На главной не показываем
if (pathname === '/') return null;
return (
<nav
className="fixed bottom-0 left-0 right-0 z-40 border-t safe-area-bottom"
style={{ borderColor: 'var(--border)', background: 'var(--bg-card)' }}
>
<div className="flex items-center justify-around py-2 max-w-2xl mx-auto">
{/* Назад */}
<button
onClick={() => router.back()}
className="flex flex-col items-center gap-1 px-4 py-1 transition-all active:scale-95"
style={{ color: 'var(--text-primary)' }}
>
<ChevronLeft className="w-6 h-6" />
<span className="text-[10px]">Назад</span>
</button>
{/* Главная */}
<button
onClick={() => router.push('/')}
className="flex flex-col items-center gap-1 px-4 py-1 transition-all active:scale-95"
style={{ color: pathname === '/' ? 'var(--primary)' : 'var(--text-primary)' }}
>
<Home className="w-6 h-6" />
<span className="text-[10px]">Главная</span>
</button>
{/* Помощь */}
<button
onClick={() => router.push('/help')}
className="flex flex-col items-center gap-1 px-4 py-1 transition-all active:scale-95"
style={{ color: pathname === '/help' ? 'var(--primary)' : 'var(--text-primary)' }}
>
<HelpCircle className="w-6 h-6" />
<span className="text-[10px]">Помощь</span>
</button>
</div>
</nav>
);
}