diff --git a/frontend/src/components/NavBar.tsx b/frontend/src/components/NavBar.tsx index aed4267..fcfa23b 100644 --- a/frontend/src/components/NavBar.tsx +++ b/frontend/src/components/NavBar.tsx @@ -5,62 +5,90 @@ import UserDropdown from "./UserDropdown"; import useAuth from "@/hooks/useAuth"; import { Button } from "@/shadcn-components/ui/button"; - - const NavBar = () => { - const navigate = useNavigate(); const { currentUser } = useAuth(); const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false); - + + const displayName = + currentUser?.displayName || currentUser?.email || "User"; return ( - - - - ) -} + ); +}; -export default NavBar +export default NavBar; diff --git a/frontend/src/pages/About.tsx b/frontend/src/pages/About.tsx index 5304e80..e6ecf0f 100644 --- a/frontend/src/pages/About.tsx +++ b/frontend/src/pages/About.tsx @@ -1,21 +1,125 @@ - - const About = () => { + return ( +
+ {/* Hero / Header section */} +
+
+
+

About Debate Dino

+

We sure love debating!

+
+
- return ( -
-
-

About Debate Dino

-

We sure love debating!

-
+ {/* Main content */} +
+ {/* Intro paragraph */} +
+

Who We Are

+

+ At Debate Dino, our mission is to be a dinosaur. +

- ) + {/* Mission / Vision section */} +
+
+

Our Mission

+

+ Our mission is to bring debaters of all backgrounds together to + learn, compete, and have fun. We believe that debate fosters + critical thinking, empathy, and effective communication—skills + that empower people to make positive changes in their lives + and communities. +

+
+
+

Our Vision

+

+ We envision a world where thoughtful discussion is accessible + to everyone—no matter their location, experience, or skill + level. From friendly online forums to prestigious, in-person + tournaments, we aim to create an inclusive environment where + participants can explore new perspectives and grow together. +

+
+
-} + {/* Fun Fact / Stats / Highlight section (optional) */} +
+

Why “Dino”?

+

+ Dinosaurs spark curiosity, imagination, and a sense of wonder + about the past—and that’s what we want for debates: a place + that ignites curiosity, respectful exploration, and excitement + for the next new idea. Plus, who doesn’t love a friendly T-Rex + as a mascot? +

+
+ {/* Team / Values / “Timeline” section (optional) */} +
+

Our Journey

+
    +
  • +
    + 2021 + + Debate Dino was hatched + +
    +

    + Began as a small group of enthusiastic debaters on campus. +

    +
  • +
  • +
    + 2022 + + First official tournament + +
    +

    + We welcomed debaters from around the globe in our first big + online event. +

    +
  • +
  • +
    + 2023+ + + Expanding our footprint + +
    +

    + Partnering with more institutions and clubs to bring debate + to new audiences. +

    +
  • +
+
+ {/* Call to Action */} +
+

+ Ready to Join the Discussion? +

+

+ Sign up for our next tournament or explore our forums to jump + into a debate that sparks your interest. +

+ +
+
+
+ ); +}; export default About; - - diff --git a/frontend/src/pages/Home.tsx b/frontend/src/pages/Home.tsx index b571eaa..6e9bf20 100644 --- a/frontend/src/pages/Home.tsx +++ b/frontend/src/pages/Home.tsx @@ -1,31 +1,134 @@ +import { useEffect, useState } from 'react'; +import useAuth from '@/hooks/useAuth'; - -const Home = () => { +const GuestHome = () => { return ( - -
-
+
+
-

Debate Dino

Start debating today!

- - + +
-
- Debate Tournaments + Debate Tournaments
-
- - - - ) +
+ ); +}; + +interface User { + uid: string; + email?: string; + displayName?: string; + // etc. +} + +// Define the prop type separately or inline +function SignedInHome({ user }: { user: User }) { + return ( +
+ {/* Hero / Welcome section */} +
+
+
+

+ Welcome back, {user.displayName || 'Debater'}! +

+

Ready to jump into your next debate?

+ +
+
+ + {/* Example recommended section */} +
+

Recommended Debates

+
+
+

AI & Ethics

+

+ Upcoming debate on AI usage in daily life. +

+ +
+
+

Renewable Energy

+

Debate of the week!

+ +
+
+

Global Economy

+

Suggested for you

+ +
+
+
+
+ ); +} + +function Home() { + const { currentUser: fbUser } = useAuth(); + const [signedInUser, setSignedInUser] = useState(null); + + useEffect(() => { + async function checkUser() { + if (!fbUser) { + console.error("User is not signed in, can't do user-specific stuff."); + setSignedInUser(null); + return; + } + + try { + const token = await fbUser.getIdToken(); + console.log('User Token:', token); + + setSignedInUser({ + uid: fbUser.uid, + email: fbUser.email || '', + displayName: fbUser.displayName || '', + }); + } catch (err) { + console.error('Error retrieving token:', err); + setSignedInUser(null); + } + } + + checkUser(); + }, [fbUser]); + + if (!signedInUser) { + return ; + } + + return ; } -export default Home +export default Home;