From e2f492ccae9afcc98ae7eb76bb94dc973aed60d8 Mon Sep 17 00:00:00 2001 From: yyamashita Date: Sat, 9 May 2026 14:11:33 +0900 Subject: simplize css --- app/routes/artist-by-uuid.tsx | 75 ++++++++------------------- app/routes/artist-edit.tsx | 71 ++++++++------------------ app/routes/artist-history.tsx | 35 +++++-------- app/routes/artist-new.tsx | 66 ++++++++---------------- app/routes/band-by-uuid.tsx | 77 +++++++++------------------- app/routes/band-edit.tsx | 112 +++++++++++++++-------------------------- app/routes/band-history.tsx | 40 ++++++--------- app/routes/band-new.tsx | 114 +++++++++++++++--------------------------- app/routes/home.tsx | 27 ++++------ 9 files changed, 203 insertions(+), 414 deletions(-) (limited to 'app/routes') diff --git a/app/routes/artist-by-uuid.tsx b/app/routes/artist-by-uuid.tsx index 9b8a4b1..6eb06a7 100644 --- a/app/routes/artist-by-uuid.tsx +++ b/app/routes/artist-by-uuid.tsx @@ -14,42 +14,23 @@ export async function loader({ params }: LoaderFunctionArgs) { export default function ArtistDetail() { const { artist, links, bands, latest } = useLoaderData(); return ( -
-
-

{artist.name}

-
- - 履歴 - - - 編集 - +
+
+

{artist.name}

+
+ 履歴 + 編集
{bands.length > 0 && ( -
-

- バンド -

-
    +
    +

    バンド

    +
      {bands.map((b) => ( -
    • - - {b.band_name} - - {b.role && ( - {b.role} - )} +
    • + {b.band_name} + {b.role && {b.role}}
    • ))}
    @@ -57,42 +38,26 @@ export default function ArtistDetail() { )} {links.length > 0 && ( -
    -

    - リンク -

    -
      +
      +

      リンク

      +
      )} -
      -
      +
      +

      /artists/of/{artist.id}

      - - /artists/named/{artist.slug} - + /artists/named/{artist.slug}

      {latest && ( -

      - 最終更新: {latest.created_at} — {latest.message} -

      +

      最終更新: {latest.created_at} — {latest.message}

      )}
diff --git a/app/routes/artist-edit.tsx b/app/routes/artist-edit.tsx index f2e5c18..e3a49af 100644 --- a/app/routes/artist-edit.tsx +++ b/app/routes/artist-edit.tsx @@ -54,24 +54,17 @@ export default function ArtistEdit() { const [links, setLinks] = useState(initLinks.map((l) => ({ label: l.label, url: l.url }))); return ( -
-
- - ← - -

Edit Artist

+
+
+ ← +

Edit Artist

-
+
- + - {errors.name &&

{errors.name}

} + {errors.name &&

{errors.name}

}
- + { setSlugManual(true); setSlug(e.target.value); }} - className="w-full bg-gray-800 border border-gray-700 rounded px-3 py-2 text-gray-100 focus:outline-none focus:border-blue-500 font-mono text-sm" + className="mono" /> - {errors.slug &&

{errors.slug}

} + {errors.slug &&

{errors.slug}

}
- -
+ +
{links.map((link, i) => ( -
+
setLinks(links.map((l, idx) => idx === i ? { ...l, label: e.target.value } : l))} placeholder="ラベル (例: X)" - className="w-28 bg-gray-800 border border-gray-700 rounded px-3 py-2 text-gray-100 focus:outline-none focus:border-blue-500 text-sm" /> setLinks(links.map((l, idx) => idx === i ? { ...l, url: e.target.value } : l))} placeholder="https://..." - className="flex-1 bg-gray-800 border border-gray-700 rounded px-3 py-2 text-gray-100 focus:outline-none focus:border-blue-500 text-sm" /> @@ -126,38 +115,22 @@ export default function ArtistEdit() {
- - - {errors.message &&

{errors.message}

} + + + {errors.message &&

{errors.message}

}
-
- - - キャンセル - +
+ + キャンセル
diff --git a/app/routes/artist-history.tsx b/app/routes/artist-history.tsx index c2fb4cb..2808927 100644 --- a/app/routes/artist-history.tsx +++ b/app/routes/artist-history.tsx @@ -12,38 +12,29 @@ export async function loader({ params }: LoaderFunctionArgs) { export default function ArtistHistory() { const { artist, revisions } = useLoaderData(); return ( -
-
- - ← - -

{artist.name} — 編集履歴

+
+
+ ← +

{artist.name} — 編集履歴

{revisions.length === 0 ? ( -

履歴がありません。

+

履歴がありません。

) : ( -
    +
      {revisions.map((rev, i) => { let snap: { name?: string; links?: unknown[] } = {}; try { snap = JSON.parse(rev.snapshot); } catch { /* ignore */ } return ( -
    1. -
      -
      -

      {rev.message}

      -

      - {rev.created_at} · {rev.ip_address} -

      +
    2. +
      +
      +

      {rev.message}

      +

      {rev.created_at} · {rev.ip_address}

      - {i === 0 && ( - 最新 - )} + {i === 0 && 最新}
      -
      +

      名前: {snap.name ?? "—"}

      リンク: {snap.links?.length ?? 0}件

      diff --git a/app/routes/artist-new.tsx b/app/routes/artist-new.tsx index 168a7cc..ce91dab 100644 --- a/app/routes/artist-new.tsx +++ b/app/routes/artist-new.tsx @@ -44,19 +44,17 @@ export default function ArtistNew() { const [links, setLinks] = useState<{ label: string; url: string }[]>([]); return ( -
      -
      - ← -

      New Artist

      +
      +
      + ← +

      New Artist

      -
      +
      - + - {errors.name &&

      {errors.name}

      } + {errors.name &&

      {errors.name}

      }
      - + { setSlugManual(true); setSlug(e.target.value); }} - className="w-full bg-gray-800 border border-gray-700 rounded px-3 py-2 text-gray-100 focus:outline-none focus:border-blue-500 font-mono text-sm" + className="mono" /> - {errors.slug &&

      {errors.slug}

      } + {errors.slug &&

      {errors.slug}

      }
      - -
      + +
      {links.map((link, i) => ( -
      +
      setLinks(links.map((l, idx) => idx === i ? { ...l, label: e.target.value } : l))} placeholder="ラベル (例: X)" - className="w-28 bg-gray-800 border border-gray-700 rounded px-3 py-2 text-gray-100 focus:outline-none focus:border-blue-500 text-sm" /> setLinks(links.map((l, idx) => idx === i ? { ...l, url: e.target.value } : l))} placeholder="https://..." - className="flex-1 bg-gray-800 border border-gray-700 rounded px-3 py-2 text-gray-100 focus:outline-none focus:border-blue-500 text-sm" /> @@ -111,38 +105,22 @@ export default function ArtistNew() {
      - - - {errors.message &&

      {errors.message}

      } + + + {errors.message &&

      {errors.message}

      }
      -
      - - - キャンセル - +
      + + キャンセル
      diff --git a/app/routes/band-by-uuid.tsx b/app/routes/band-by-uuid.tsx index 9cb4d33..99a8b5c 100644 --- a/app/routes/band-by-uuid.tsx +++ b/app/routes/band-by-uuid.tsx @@ -26,50 +26,33 @@ const STATUS_LABEL: Record = { export default function BandDetail() { const { band, links, artists, latest } = useLoaderData(); return ( -
      -
      -
      -

      {band.name}

      -
      +
      +
      +
      +

      {band.name}

      +
      {band.area && {band.area}} {STATUS_LABEL[band.status] ?? band.status}
      {band.description && ( -

      {band.description}

      +

      {band.description}

      )}
      -
      - - 履歴 - - - 編集 - +
      + 履歴 + 編集
      {artists.length > 0 && ( -
      -

      - メンバー -

      -
        +
        +

        メンバー

        +
          {artists.map((a) => ( -
        • - - {a.artist_name} - +
        • + {a.artist_name} {a.role && a.role.split(", ").filter(Boolean).map((r, i) => ( - {r} + {r} ))}
        • ))} @@ -78,19 +61,12 @@ export default function BandDetail() { )} {links.length > 0 && ( -
          -

          - リンク -

          -
            +
            +

            リンク

            +
            )} -
            -
            +
            +

            /bands/of/{band.id}

            - - /bands/named/{band.slug} - + /bands/named/{band.slug}

            {latest && ( -

            - 最終更新: {latest.created_at} — {latest.message} -

            +

            最終更新: {latest.created_at} — {latest.message}

            )}
      diff --git a/app/routes/band-edit.tsx b/app/routes/band-edit.tsx index 0a98bd6..2e29277 100644 --- a/app/routes/band-edit.tsx +++ b/app/routes/band-edit.tsx @@ -97,13 +97,13 @@ export default function BandEdit() { } return ( -
      -
      - ← -

      Edit Band

      +
      +
      + ← +

      Edit Band

      -
      +
      - + { setName(e.target.value); if (!slugManual) setSlug(toSlug(e.target.value)); }} - className="w-full bg-gray-800 border border-gray-700 rounded px-3 py-2 text-gray-100 focus:outline-none focus:border-blue-500" /> - {errors.name &&

      {errors.name}

      } + {errors.name &&

      {errors.name}

      }
      - + { setSlugManual(true); setSlug(e.target.value); }} - className="w-full bg-gray-800 border border-gray-700 rounded px-3 py-2 text-gray-100 focus:outline-none focus:border-blue-500 font-mono text-sm" + className="mono" /> - {errors.slug &&

      {errors.slug}

      } + {errors.slug &&

      {errors.slug}

      }
      - - + +
      - - @@ -160,24 +147,18 @@ export default function BandEdit() {
      - -