diff options
| author | yyamashita <yyamashita@mosquit.one> | 2026-05-15 00:08:25 +0900 |
|---|---|---|
| committer | yyamashita <yyamashita@mosquit.one> | 2026-05-15 00:08:25 +0900 |
| commit | 1a8a159a71fd018bab0e14d9df952c53ae5ea062 (patch) | |
| tree | e49843e7b1178e063b7f7fd3ad05601affdbfd28 /app/routes/home.tsx | |
| parent | 83524404e891cf256e191677e1150e853e185155 (diff) | |
Add bands/artists index pages and redirect top page
- / now redirects to /bands
- /bands shows band list with "+ Band" link
- /artists shows artist list with "+ Artist" link
- Nav simplified to Bands / Artists only
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'app/routes/home.tsx')
| -rw-r--r-- | app/routes/home.tsx | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/app/routes/home.tsx b/app/routes/home.tsx index ef6912d..9795ba8 100644 --- a/app/routes/home.tsx +++ b/app/routes/home.tsx @@ -1,31 +1,9 @@ -import { Link, useLoaderData } from "react-router"; -import { listBands } from "~/lib/db.server"; +import { redirect } from "react-router"; export function loader() { - return { bands: listBands() }; + return redirect("/bands"); } export default function Home() { - const { bands } = useLoaderData<typeof loader>(); - return ( - <main> - {bands.length === 0 ? ( - <p className="muted"> - バンドがまだありません。{" "} - <Link to="/bands/new">追加する</Link> - </p> - ) : ( - <ul className="band-list"> - {bands.map((band) => ( - <li key={band.id}> - <Link to={`/bands/of/${band.id}`}>{band.name}</Link> - {band.status === "hiatus" && ( - <span className="muted" style={{ fontSize: ".75rem" }}>活動休止</span> - )} - </li> - ))} - </ul> - )} - </main> - ); + return null; } |
