From fbacd406446ca6844937bb55ec9063af01e89ad1 Mon Sep 17 00:00:00 2001 From: pietvanzoen Date: Wed, 5 Jul 2023 23:08:02 +0200 Subject: [PATCH] Set the page title for the user's gifs page --- app/routes/users.$username.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/routes/users.$username.tsx b/app/routes/users.$username.tsx index 48c2e44..2818046 100644 --- a/app/routes/users.$username.tsx +++ b/app/routes/users.$username.tsx @@ -1,16 +1,21 @@ import type { Prisma } from "@prisma/client"; -import type { LoaderArgs } from "@remix-run/node"; +import type { LoaderArgs, V2_MetaArgs } from "@remix-run/node"; import { json } from "@remix-run/node"; import { Link, useLoaderData } from "@remix-run/react"; import MediaList, { loadMedia, MEDIA_LIST_LINKS } from "~/components/MediaList"; import QuickSearch from "~/components/QuickSearch"; import { getMediaLabels } from "~/utils/media.server"; +import { makeTitle } from "~/utils/meta"; import { requireUserId } from "~/utils/session.server"; export function links() { return MEDIA_LIST_LINKS; } +export function meta({ data }: V2_MetaArgs) { + return [{ title: makeTitle([`${data?.username}'s gifs`]) }]; +} + export async function loader({ request, params }: LoaderArgs) { await requireUserId(request); const queryParams = new URLSearchParams(request.url.split("?")[1]);