From 6603ddfe234187ed6c49ae71731ec0f9a660f018 Mon Sep 17 00:00:00 2001 From: Alexis Date: Tue, 2 Jun 2026 10:44:51 +0200 Subject: [PATCH] feat(ui): mejorar estilos y estructura de componentes en el dashboard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Se ajustan los estilos y la estructura de varios componentes en el dashboard, incluyendo ExportDropdown, ResearcherCard, SwordProfileSelect y SyncButton, para mejorar la presentación y la responsividad. Se añade soporte para clases personalizadas en SyncButton y se integra el nuevo sistema de exportación en GroupResultsPage. --- .../components/dashboard/ExportDropdown.jsx | 5 +- .../components/dashboard/ResearcherCard.jsx | 2 +- .../dashboard/SwordProfileSelect.jsx | 22 ++++--- .../src/components/dashboard/SyncButton.jsx | 4 +- frontend/src/pages/DashboardPage.jsx | 6 +- frontend/src/pages/GroupResultsPage.jsx | 66 ++++++++----------- 6 files changed, 51 insertions(+), 54 deletions(-) diff --git a/frontend/src/components/dashboard/ExportDropdown.jsx b/frontend/src/components/dashboard/ExportDropdown.jsx index d9a5c23..88e38d8 100644 --- a/frontend/src/components/dashboard/ExportDropdown.jsx +++ b/frontend/src/components/dashboard/ExportDropdown.jsx @@ -49,19 +49,20 @@ export function ExportDropdown({ } return ( -
+
{actions && ( -
+
{actions}
)} diff --git a/frontend/src/components/dashboard/SwordProfileSelect.jsx b/frontend/src/components/dashboard/SwordProfileSelect.jsx index 77c7fc1..2d9f651 100644 --- a/frontend/src/components/dashboard/SwordProfileSelect.jsx +++ b/frontend/src/components/dashboard/SwordProfileSelect.jsx @@ -48,28 +48,32 @@ export function SwordProfileSelect({ return (
- Destino: -
+ + Destino: + +
{open && (
{options.map(({ value: optionValue, label, desc }, idx) => (
-
+
{desc}
diff --git a/frontend/src/components/dashboard/SyncButton.jsx b/frontend/src/components/dashboard/SyncButton.jsx index 70a6469..bca8420 100644 --- a/frontend/src/components/dashboard/SyncButton.jsx +++ b/frontend/src/components/dashboard/SyncButton.jsx @@ -5,7 +5,7 @@ import { Spinner } from "../ui/Spinner"; * Primary action button on the dashboard. Swaps icon + colour scheme * depending on the sync lifecycle (idle → loading → success flash). */ -export function SyncButton({ onClick, status = "idle" }) { +export function SyncButton({ onClick, status = "idle", className = "" }) { const isLoading = status === "loading"; const isSuccess = status === "success"; @@ -20,7 +20,7 @@ export function SyncButton({ onClick, status = "idle" }) { type="button" onClick={onClick} disabled={isLoading} - className={`inline-flex items-center gap-2 rounded-lg px-[18px] py-2.5 text-sm font-medium transition-colors disabled:cursor-not-allowed ${palette}`} + className={`inline-flex items-center justify-center gap-2 rounded-lg px-[18px] py-2.5 text-sm font-medium transition-colors disabled:cursor-not-allowed ${palette} ${className}`.trim()} > {isLoading ? ( diff --git a/frontend/src/pages/DashboardPage.jsx b/frontend/src/pages/DashboardPage.jsx index bedf4dd..b0c60a4 100644 --- a/frontend/src/pages/DashboardPage.jsx +++ b/frontend/src/pages/DashboardPage.jsx @@ -224,7 +224,11 @@ export function DashboardPage() { researcher={researcher} actions={ <> - + 0 - ? `Descargar lo nuevo de todos (${allNewIds.length})` - : "Todo descargado" - : `Descargar todo (${allIds.length})`; - - const globalDisabled = - Boolean(globalExporting) || - (isAuthenticated ? allNewIds.length === 0 : allIds.length === 0); - return (
@@ -233,33 +239,15 @@ export function GroupResultsPage() { {/* Global export buttons */} {!loading && results.length > 0 && ( -
- - {["xml", "zip"].map((fmt) => ( - - ))} -
+ )}