diff --git a/README.md b/README.md index 68bfbf8..b967cbe 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Open http://localhost:3000. ## Routes - `/` - search for a handle, DID, or `at://` URI -- `/?mode=artist` - the same search, stripped to the player it finds +- `/?faaah` - the same search, stripped to the player it finds - `/player/[actor]` - one player: avatar, name, badges, nothing technical - `/at/[actor]` - repo overview - `/at/[actor]/[collection]` - records in a collection diff --git a/src/app/page.tsx b/src/app/page.tsx index dcea7d7..0b3e34b 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -12,7 +12,7 @@ import { Wordmark } from "@/components/wordmark"; import { actorId, normalizeActor, parseAtUri } from "@/lib/atproto/uri"; import { getFolkLexicons, getFolkRepos, summarize } from "@/lib/folk"; import { hrefForAtUri, playerHref, repoHref } from "@/lib/links"; -import { parseMode } from "@/lib/mode"; +import { ARTIST_PARAM, parseMode } from "@/lib/mode"; import { listPlayers } from "@/lib/player"; import { SITE_DESCRIPTION, @@ -24,7 +24,7 @@ import { import styles from "./page.module.css"; export const metadata: Metadata = { - // `?invalid=` is a rendering detail of the search form and `?mode=` is a + // `?invalid=` is a rendering detail of the search form and `?faaah` is a // choice of view, never a distinct page. alternates: { canonical: "/" }, openGraph: { @@ -62,12 +62,13 @@ async function findPlayer(formData: FormData) { const actor = normalizeActor(input); if (actor) redirect(playerHref(actorId(actor))); - redirect(`/?mode=artist&invalid=${encodeURIComponent(input)}`); + redirect(`/?${ARTIST_PARAM}&invalid=${encodeURIComponent(input)}`); } export default async function Home({ searchParams }: PageProps<"/">) { - const { invalid, mode: modeParam } = await searchParams; - const mode = parseMode(modeParam); + const params = await searchParams; + const { invalid } = params; + const mode = parseMode(params); const header = (