From 56e0c8a31fab13511e983e8cec58aaaba6e86948 Mon Sep 17 00:00:00 2001 From: joshua Date: Fri, 7 Aug 2026 01:52:35 +0200 Subject: [PATCH] Fix Join Us button linking logged-in users to register page Send logged-in users to their dashboard instead of the registration form, matching how the Navbar already treats logged-in vs guest users. Co-Authored-By: Claude Sonnet 5 --- CHANGELOG.md | 4 ++++ frontend/src/app/page.tsx | 8 +++---- frontend/src/components/home/JoinUsButton.tsx | 23 +++++++++++++++++++ 3 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 frontend/src/components/home/JoinUsButton.tsx diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e815b4..b2fe9a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project follows [Semantic Versioning](https://semver.org/). ## [Unreleased] +### Fixed + +- The homepage "Join Us" button sent logged-in users to the registration page instead of somewhere useful. It now shows "My Dashboard" and links to their dashboard when a user is already logged in. + ## [1.5.3] - 2026-08-07 ### Fixed diff --git a/frontend/src/app/page.tsx b/frontend/src/app/page.tsx index b923672..fee5de1 100644 --- a/frontend/src/app/page.tsx +++ b/frontend/src/app/page.tsx @@ -1,8 +1,9 @@ import { EventCard } from "@/components/events/EventCard"; import { Navbar } from "@/components/layout/Navbar"; import { Footer } from "@/components/layout/Footer"; +import { JoinUsButton } from "@/components/home/JoinUsButton"; import { appName } from "@/lib/siteConfig"; -import { Calendar, UserPlus, ArrowRight, CalendarCheck, Users, Heart, ShieldCheck } from "lucide-react"; +import { Calendar, ArrowRight, CalendarCheck, Users, Heart, ShieldCheck } from "lucide-react"; type Event = { id: string; @@ -58,10 +59,7 @@ export default async function HomePage() { View Events - - - Join Us - + diff --git a/frontend/src/components/home/JoinUsButton.tsx b/frontend/src/components/home/JoinUsButton.tsx new file mode 100644 index 0000000..18ca3d3 --- /dev/null +++ b/frontend/src/components/home/JoinUsButton.tsx @@ -0,0 +1,23 @@ +"use client"; + +import Link from "next/link"; +import { UserPlus, LayoutDashboard } from "lucide-react"; +import { useAuth } from "@/hooks/useAuth"; + +export const JoinUsButton = () => { + const { user, loading } = useAuth(); + + if (loading) return null; + + return user ? ( + + + My Dashboard + + ) : ( + + + Join Us + + ); +};