diff --git a/apps/frontend/app/page.tsx b/apps/frontend/app/page.tsx index 9c0444e..fcf910f 100644 --- a/apps/frontend/app/page.tsx +++ b/apps/frontend/app/page.tsx @@ -21,10 +21,31 @@ import { Anchor, Container, FileText, + LayoutDashboard, } from 'lucide-react'; +import { useAuth } from '@/lib/context/auth-context'; export default function LandingPage() { const [isScrolled, setIsScrolled] = useState(false); + const { user, isAuthenticated, loading } = useAuth(); + + // Helper function to get user initials + const getUserInitials = () => { + if (!user) return ''; + const firstInitial = user.firstName?.charAt(0)?.toUpperCase() || ''; + const lastInitial = user.lastName?.charAt(0)?.toUpperCase() || ''; + return firstInitial + lastInitial || user.email?.charAt(0)?.toUpperCase() || '?'; + }; + + // Helper function to get full name + const getFullName = () => { + if (!user) return ''; + if (user.firstName && user.lastName) { + return `${user.firstName} ${user.lastName}`; + } + return user.email || ''; + }; + const heroRef = useRef(null); const featuresRef = useRef(null); const statsRef = useRef(null); @@ -225,18 +246,42 @@ export default function LandingPage() { > Tarifs - - Connexion - - - Commencer Gratuitement - + + {/* Affichage conditionnel: connecté vs non connecté */} + {loading ? ( +
+ ) : isAuthenticated && user ? ( + + {/* Avatar avec initiales */} +