From c53c40cf0b54a94c163f28ebd504dd720ff03339 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Falc=C3=B3n?= Date: Mon, 8 Jun 2026 09:51:35 +0200 Subject: [PATCH] feat(landing): add go now button to redirect modal (#506) ## Summary On the landing page, logged-in users see a modal with a three-second progress bar that redirects them to the dashboard. This adds a primary **Go now** button so users can skip the wait. - Move **Cancel** button to the left, add primary **Go now** button on the right (`sm:justify-between`) - `Go now` calls `router.visit(dashboard())` immediately - Added `Go now` Spanish translation (CI enforces `es.json`) ## Testing - Added test: redirects immediately when clicking go now - All 4 dialog tests pass --- lang/es.json | 1 + .../landing/authenticated-redirect-dialog.test.tsx | 8 ++++++++ .../landing/authenticated-redirect-dialog.tsx | 10 +++++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lang/es.json b/lang/es.json index 4d0c63ee..b9c82762 100644 --- a/lang/es.json +++ b/lang/es.json @@ -696,6 +696,7 @@ "Get started at no cost. No bank connections included.": "Empieza sin coste. Sin conexiones bancarias incluidas.", "Get started quickly with your existing financial data.": "Comienza rápidamente con tus datos financieros existentes.", "Github": "Github", + "Go now": "Ir ahora", "Go to Dashboard": "Ir al Panel", "Go to Settings": "Ir a Configuración", "Go to your account's transaction history": "Ve al historial de transacciones de tu cuenta", diff --git a/resources/js/components/landing/authenticated-redirect-dialog.test.tsx b/resources/js/components/landing/authenticated-redirect-dialog.test.tsx index e60c1bbc..bb208d82 100644 --- a/resources/js/components/landing/authenticated-redirect-dialog.test.tsx +++ b/resources/js/components/landing/authenticated-redirect-dialog.test.tsx @@ -63,6 +63,14 @@ describe('AuthenticatedRedirectDialog', () => { ).toBe('50'); }); + it('redirects immediately when clicking go now', () => { + render(); + + fireEvent.click(screen.getByRole('button', { name: 'Go now' })); + + expect(mocks.routerVisit).toHaveBeenCalledWith(dashboard()); + }); + it('cancels the redirect and closes the modal', () => { render(); diff --git a/resources/js/components/landing/authenticated-redirect-dialog.tsx b/resources/js/components/landing/authenticated-redirect-dialog.tsx index 5eb9d00b..7103e6e6 100644 --- a/resources/js/components/landing/authenticated-redirect-dialog.tsx +++ b/resources/js/components/landing/authenticated-redirect-dialog.tsx @@ -60,6 +60,11 @@ export default function AuthenticatedRedirectDialog({ setIsOpen(false); } + function redirectNow(): void { + setProgress(100); + router.visit(dashboard()); + } + return ( @@ -84,7 +89,7 @@ export default function AuthenticatedRedirectDialog({ style={{ width: `${progress}%` }} /> - + +