diff --git a/app/author/[id]/page.tsx b/app/author/[id]/page.tsx index 5b29b5957..a6fcbea02 100644 --- a/app/author/[id]/page.tsx +++ b/app/author/[id]/page.tsx @@ -1,6 +1,6 @@ 'use client'; -import { use, useTransition } from 'react'; +import { use, useTransition, useEffect } from 'react'; import { useAuthorAchievements, useAuthorInfo, useAuthorSummaryStats } from '@/hooks/useAuthor'; import { useUser } from '@/contexts/UserContext'; import { Card } from '@/components/ui/Card'; @@ -246,6 +246,13 @@ export default function AuthorProfilePage({ params }: { params: Promise<{ id: st const [{ summaryStats, isLoading: isSummaryStatsLoading, error: summaryStatsError }] = useAuthorSummaryStats(authorId); + // Update document title when author data is loaded + useEffect(() => { + if (user?.authorProfile?.fullName) { + document.title = `${user.authorProfile.fullName} | ResearchHub`; + } + }, [user?.authorProfile?.fullName]); + if (isLoading || isUserLoading) { return ( <>