brackt/app/routes/user-profile.tsx
Chris Parsons d784571f29
feat: add meta title to all route pages (#109)
Every route now exports a meta function so the browser title bar reflects
the current page. Static pages use fixed titles; dynamic pages pull names
from loader data with a sensible fallback (e.g. league name, sport season
name, team name).

Titles follow the pattern "Page Name - Brackt" for user-facing routes and
"Page Name - Brackt Admin" for admin routes.

Fixes #74

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10 12:10:52 -07:00

26 lines
623 B
TypeScript

import { UserProfile } from "@clerk/react-router";
import { getAuth } from "@clerk/react-router/server";
import { redirect } from "react-router";
import type { Route } from "./+types/user-profile";
export function meta(): Route.MetaDescriptors {
return [{ title: "Profile - Brackt" }];
}
export async function loader(args: Route.LoaderArgs) {
const { userId } = await getAuth(args);
if (!userId) {
return redirect("/");
}
return {};
}
export default function UserProfilePage() {
return (
<div className="container mx-auto py-8 px-4 flex justify-center">
<UserProfile />
</div>
);
}