Skip to content

Commit

Permalink
Set the page title for the user's gifs page
Browse files Browse the repository at this point in the history
  • Loading branch information
pietvanzoen committed Jul 5, 2023
1 parent 4448470 commit fbacd40
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/routes/users.$username.tsx
Original file line number Diff line number Diff line change
@@ -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<typeof loader>) {
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]);

0 comments on commit fbacd40

Please sign in to comment.