From 4f97bfeeaaf871f92dc09ce278857c27608e350c Mon Sep 17 00:00:00 2001 From: mcinquin Date: Sun, 17 May 2026 22:58:35 +0200 Subject: [PATCH 1/2] fix(ui): fix some issues with ui on mobile device --- messages/en.json | 1 + messages/fr.json | 1 + src/app/(app)/admin/page.tsx | 23 ++- src/app/(app)/page.tsx | 10 +- src/components/admin/admin-cards-section.tsx | 149 +++++++++++++++++- .../admin/admin-catalog-section.tsx | 7 +- src/components/admin/admin-clubs-section.tsx | 9 +- .../admin/admin-players-section.tsx | 9 +- src/components/admin/admin-years-section.tsx | 9 +- src/components/admin/batch-text-import.tsx | 8 +- src/components/dashboard-charts.tsx | 20 ++- src/components/recent-cards.tsx | 6 +- src/components/stats-cards.tsx | 16 +- 13 files changed, 226 insertions(+), 42 deletions(-) diff --git a/messages/en.json b/messages/en.json index f23548b..3854b52 100644 --- a/messages/en.json +++ b/messages/en.json @@ -29,6 +29,7 @@ "save": "Save", "saving": "Saving…", "add": "Add", + "edit": "Edit", "delete": "Delete", "retry": "Retry", "error": "Error", diff --git a/messages/fr.json b/messages/fr.json index b1bc900..c1f2616 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -29,6 +29,7 @@ "save": "Enregistrer", "saving": "Enregistrement…", "add": "Ajouter", + "edit": "Modifier", "delete": "Supprimer", "retry": "Réessayer", "error": "Erreur", diff --git a/src/app/(app)/admin/page.tsx b/src/app/(app)/admin/page.tsx index 5efb01d..c1cbf14 100644 --- a/src/app/(app)/admin/page.tsx +++ b/src/app/(app)/admin/page.tsx @@ -108,24 +108,31 @@ export default function AdminPage() { } return ( -
-
-
-

{t("admin.title")}

-

+

+
+
+

+ {t("admin.title")} +

+

{t("admin.subtitle", { count: cards.length })}

-
- + {tabs.map((tab) => ( - + {tab.label} ))} diff --git a/src/app/(app)/page.tsx b/src/app/(app)/page.tsx index 96ea842..a180b05 100644 --- a/src/app/(app)/page.tsx +++ b/src/app/(app)/page.tsx @@ -20,12 +20,14 @@ export default async function DashboardPage() { }; return ( -
-
-

+
+
+

{t("dashboard.title")}

-

{t("dashboard.subtitle")}

+

+ {t("dashboard.subtitle")} +

-
+
+

{t("admin.cards.intro")}

-
+
+ { + setPlayerColumnFilter(nextValue); + setPage(0); + }} + placeholder={t("admin.cards.filterPlayerTeam")} + suggestions={columnSuggestions.players} + className="h-9 text-xs" + /> + { + setTeamColumnFilter(nextValue); + setPage(0); + }} + placeholder={t("admin.cards.filterTeam")} + suggestions={columnSuggestions.teams} + className="h-9 text-xs" + /> +
+ { + setYearColumnFilter(nextValue); + setPage(0); + }} + placeholder={t("admin.cards.filterYear")} + suggestions={columnSuggestions.years} + className="h-9 text-xs" + /> + { + setTagsColumnFilter(nextValue); + setPage(0); + }} + placeholder={t("admin.cards.filterTags")} + suggestions={columnSuggestions.tags} + className="h-9 text-xs" + /> +
+ { + setBrandColumnFilter(nextValue); + setPage(0); + }} + placeholder={t("admin.cards.filterBrand")} + suggestions={columnSuggestions.brands} + className="h-9 text-xs" + /> + { + setSetColumnFilter(nextValue); + setPage(0); + }} + placeholder={t("admin.cards.filterSet")} + suggestions={columnSuggestions.sets} + className="h-9 text-xs" + /> + { + setVariationColumnFilter(nextValue); + setPage(0); + }} + placeholder={t("admin.cards.filterVariation")} + suggestions={columnSuggestions.variations} + className="h-9 text-xs" + /> +
+ +
+ {paged.length ? ( + paged.map((card) => { + const meta = [card.team, card.year].filter(Boolean).join(" · "); + const catalog = [card.brand, card.set].filter(Boolean).join(" · "); + + return ( +
+
+
+

+ {card.player} +

+

{meta}

+
+ +
+ +
+

{catalog}

+

{card.variation}

+
+ +
+ + +
+
+ ); + }) + ) : ( +
+ {t("cards.noneFound")} +
+ )} +
+ +
@@ -567,7 +708,7 @@ export function AdminCardsSection({ {totalPages > 1 && ( -
+

{t("admin.cards.pageInfo", { page: page + 1, diff --git a/src/components/admin/admin-catalog-section.tsx b/src/components/admin/admin-catalog-section.tsx index 2035496..cb2d9b9 100644 --- a/src/components/admin/admin-catalog-section.tsx +++ b/src/components/admin/admin-catalog-section.tsx @@ -220,7 +220,7 @@ export function AdminCatalogSection({

{t("admin.catalog.intro")}

- + {t("admin.catalog.brands")} {t("admin.catalog.sets")} {t("admin.catalog.variations")} @@ -230,7 +230,7 @@ export function AdminCatalogSection({
-
+
diff --git a/src/components/admin/admin-players-section.tsx b/src/components/admin/admin-players-section.tsx index ac900bf..4a744fe 100644 --- a/src/components/admin/admin-players-section.tsx +++ b/src/components/admin/admin-players-section.tsx @@ -64,7 +64,7 @@ export function AdminPlayersSection({
-
+
-
diff --git a/src/components/admin/admin-years-section.tsx b/src/components/admin/admin-years-section.tsx index 531a8a5..07b9f36 100644 --- a/src/components/admin/admin-years-section.tsx +++ b/src/components/admin/admin-years-section.tsx @@ -70,7 +70,7 @@ export function AdminYearsSection({
-
+
-
diff --git a/src/components/admin/batch-text-import.tsx b/src/components/admin/batch-text-import.tsx index e89c38f..de9d019 100644 --- a/src/components/admin/batch-text-import.tsx +++ b/src/components/admin/batch-text-import.tsx @@ -68,7 +68,13 @@ export function BatchTextImport({ error={error} onSuccessDismiss={() => setSuccess(null)} /> -
diff --git a/src/components/dashboard-charts.tsx b/src/components/dashboard-charts.tsx index 3541a71..c406276 100644 --- a/src/components/dashboard-charts.tsx +++ b/src/components/dashboard-charts.tsx @@ -99,13 +99,13 @@ export function DashboardCharts({ cards }: DashboardChartsProps) { .map(([name, count]) => ({ name, count })); return ( -
-
+
+

{t("dashboard.byBrand")}

- +
-
+

{t("dashboard.byYear")}

- +
-
+

{t("dashboard.topPlayers")}

- + ( diff --git a/src/components/recent-cards.tsx b/src/components/recent-cards.tsx index c2f4347..e48d84b 100644 --- a/src/components/recent-cards.tsx +++ b/src/components/recent-cards.tsx @@ -15,7 +15,7 @@ export function RecentCards({ cards, title, badgeLabels }: RecentCardsProps) { .slice(0, 8); return ( -
+

{title}

@@ -23,7 +23,7 @@ export function RecentCards({ cards, title, badgeLabels }: RecentCardsProps) { {recent.map((card) => (

{card.player}

@@ -31,7 +31,7 @@ export function RecentCards({ cards, title, badgeLabels }: RecentCardsProps) { {card.year} {card.brand} {card.set} - {card.variation}

-
+
{formatOpeningDateLabel(card.openingDate)} diff --git a/src/components/stats-cards.tsx b/src/components/stats-cards.tsx index c99a712..f2fbd46 100644 --- a/src/components/stats-cards.tsx +++ b/src/components/stats-cards.tsx @@ -67,17 +67,21 @@ export function StatsCards({ cards, labels }: StatsCardsProps) { ]; return ( -
+
{stats.map((stat) => (
-
- - {stat.label} +
+ + + {stat.label} +
-

{stat.value.toLocaleString()}

+

+ {stat.value.toLocaleString()} +

))}
From 18f1a66c0e88014a2d8f02789d394341e78254de Mon Sep 17 00:00:00 2001 From: mcinquin Date: Sun, 17 May 2026 23:14:45 +0200 Subject: [PATCH 2/2] fix(ui): fix issues for admin section on mobile device --- src/app/(app)/admin/page.tsx | 23 +++++++++++++--- src/components/admin/admin-cards-section.tsx | 8 +++--- .../admin/admin-catalog-section.tsx | 27 +++++++++++++++---- src/components/card-table.tsx | 6 ++--- 4 files changed, 49 insertions(+), 15 deletions(-) diff --git a/src/app/(app)/admin/page.tsx b/src/app/(app)/admin/page.tsx index c1cbf14..badf2f7 100644 --- a/src/app/(app)/admin/page.tsx +++ b/src/app/(app)/admin/page.tsx @@ -18,6 +18,7 @@ export default function AdminPage() { const [references, setReferences] = useState(null); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); + const [activeTab, setActiveTab] = useState("cards"); const tabs = useMemo( () => [ @@ -129,10 +130,26 @@ export default function AdminPage() {
- - + + + + {tabs.map((tab) => ( - + {tab.label} ))} diff --git a/src/components/admin/admin-cards-section.tsx b/src/components/admin/admin-cards-section.tsx index 0a1d4a0..8d5d86e 100644 --- a/src/components/admin/admin-cards-section.tsx +++ b/src/components/admin/admin-cards-section.tsx @@ -489,7 +489,7 @@ export function AdminCardsSection({ />
-
+
{paged.length ? ( paged.map((card) => { const meta = [card.team, card.year].filter(Boolean).join(" · "); @@ -498,7 +498,7 @@ export function AdminCardsSection({ return (
@@ -510,12 +510,12 @@ export function AdminCardsSection({
-
+

{catalog}

{card.variation}

-
+