From 25042d0fecf0aed993ba5adb5d610d4a10b37905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Gierwia=C5=82o?= Date: Fri, 5 Dec 2025 17:21:55 +0100 Subject: [PATCH] feat(home): adapt homepage for authenticated users Changes for logged-in users: - Top navigation: Show "Dashboard" and "Logout" buttons instead of "Sign In" and "Get Started" - Hero CTA: Change main button to "Go to Dashboard" instead of "Start Collaborating" - Hide bottom CTA section (registration prompt) for authenticated users - Footer Account section: Show "Dashboard" and "Logout" instead of "Sign In" and "Register" Other improvements: - Removed "Explore Events" button from hero section - Cleaned up footer: removed empty placeholder links (Features, How It Works, About, Privacy, Terms) - Added "Support" section in footer with "Contact Us" link to /contact - Simplified footer to 3 columns: Product (Events), Support (Contact Us), Account (dynamic based on auth) --- frontend/src/pages/HomePage.jsx | 181 ++++++++++++++++++-------------- 1 file changed, 102 insertions(+), 79 deletions(-) diff --git a/frontend/src/pages/HomePage.jsx b/frontend/src/pages/HomePage.jsx index 0294610..c85128c 100644 --- a/frontend/src/pages/HomePage.jsx +++ b/frontend/src/pages/HomePage.jsx @@ -1,7 +1,16 @@ -import { Link } from 'react-router-dom'; -import { Video, Users, Zap, Shield, Camera, MessageCircle, Star } from 'lucide-react'; +import { Link, useNavigate } from 'react-router-dom'; +import { Video, Users, Zap, Shield, Camera, MessageCircle, Star, LogOut, LayoutDashboard } from 'lucide-react'; +import { useAuth } from '../contexts/AuthContext'; const HomePage = () => { + const { user, logout } = useAuth(); + const navigate = useNavigate(); + + const handleLogout = () => { + logout(); + navigate('/login'); + }; + return (
{/* Hero Section */} @@ -13,18 +22,39 @@ const HomePage = () => { spotlight.cam
- - Sign in - - - Get Started - + {user ? ( + <> + + + Dashboard + + + + ) : ( + <> + + Sign in + + + Get Started + + + )}
@@ -36,18 +66,12 @@ const HomePage = () => {

Connect with competitors, record each other's rounds, and swap videos in seconds.

-
+
- Start Collaborating - - - Explore Events + {user ? "Go to Dashboard" : "Start Collaborating"}
@@ -203,22 +227,24 @@ const HomePage = () => { {/* CTA Section */} -
-
-

- Ready to elevate your competition experience? -

-

- Join dancers from around the world who are already collaborating on spotlight.cam -

- - Create Your Free Account - -
-
+ {!user && ( +
+
+

+ Ready to elevate your competition experience? +

+

+ Join dancers from around the world who are already collaborating on spotlight.cam +

+ + Create Your Free Account + +
+
+ )} {/* Footer */}