UI: доработано оформление — тени, анимации, градиенты, iOS-стиль

This commit is contained in:
2026-05-29 11:52:04 +03:00
parent a67b8c3341
commit f8f220469c
13 changed files with 362 additions and 727 deletions

View File

@@ -1,20 +1,24 @@
import { Navigate } from 'react-router-dom';
import { useAuth } from '@/hooks/useAuth';
import { Cat } from 'lucide-react';
export default function ProtectedRoute({ children }: { children: React.ReactNode }) {
const { user, isLoading } = useAuth();
if (isLoading) {
return (
<div className="flex h-screen items-center justify-center">
<div className="h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" />
<div className="flex h-screen items-center justify-center bg-[var(--bg)]">
<div className="flex flex-col items-center gap-4">
<div className="h-14 w-14 rounded-full flex items-center justify-center" style={{ background: 'linear-gradient(135deg, #007aff, #5856d6)' }}>
<Cat className="h-7 w-7 text-white" strokeWidth={1.5} />
</div>
<div className="h-6 w-6 rounded-full border-2 border-[var(--primary)]/30 border-t-[var(--primary)] animate-spin" />
</div>
</div>
);
}
if (!user) {
return <Navigate to="/login" replace />;
}
if (!user) return <Navigate to="/login" replace />;
return <>{children}</>;
}
}