From e30c608e50a219385fae9acf89eaf60a7ab7268b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Garc=C3=ADa=20M=C3=A9ndez?= Date: Sat, 14 Mar 2026 13:47:56 -0500 Subject: [PATCH] Fix remaining UI items: withdrawal modal, placeholder, hide amount on full, remove deposit subtitle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove subtitle under Depósitos heading - Change withdrawal amount placeholder to "1,000.00" - Add withdrawal-specific success modal (title: "Retiro solicitado") - Hide amount field when "Retiro total" is selected instead of disabling - Update tests accordingly --- .../features/requests/WithdrawalForm.jsx | 32 ++++++++++--------- .../features/requests/WithdrawalForm.test.jsx | 9 +++--- src/i18n.js | 10 ++++-- src/pages/WalletsPage.jsx | 1 - 4 files changed, 29 insertions(+), 23 deletions(-) diff --git a/src/components/features/requests/WithdrawalForm.jsx b/src/components/features/requests/WithdrawalForm.jsx index 7591912..b4c67ed 100644 --- a/src/components/features/requests/WithdrawalForm.jsx +++ b/src/components/features/requests/WithdrawalForm.jsx @@ -57,8 +57,8 @@ export const WithdrawalForm = ({ userEmail, currentBalance }) => { if (apiResult.data) { setModal({ type: 'success', - title: t('requests.registered.title'), - message: t('requests.registered.crypto'), + title: t('requests.registered.withdrawalTitle'), + message: t('requests.registered.withdrawal'), }); setAmount(''); setType('partial'); @@ -177,19 +177,21 @@ export const WithdrawalForm = ({ userEmail, currentBalance }) => { - setAmount(e.target.value)} - disabled={type === 'full' || loading} - required={type === 'partial'} - min="0.01" - step="0.01" - placeholder={t('withdrawals.form.amount.placeholder')} - /> + {type === 'partial' && ( + setAmount(e.target.value)} + disabled={loading} + required + min="0.01" + step="0.01" + placeholder={t('withdrawals.form.amount.placeholder')} + /> + )}

{t('withdrawals.processingHoursTitle')}

diff --git a/src/components/features/requests/WithdrawalForm.test.jsx b/src/components/features/requests/WithdrawalForm.test.jsx index adc4418..cefd924 100644 --- a/src/components/features/requests/WithdrawalForm.test.jsx +++ b/src/components/features/requests/WithdrawalForm.test.jsx @@ -44,7 +44,7 @@ describe('WithdrawalForm', () => { expect(screen.getByText('Withdrawal type')).toBeInTheDocument(); const amountInput = screen.getByLabelText(/Amount/); - expect(amountInput).toHaveAttribute('placeholder', 'Enter amount in USD'); + expect(amountInput).toHaveAttribute('placeholder', '1,000.00'); expect(screen.getByRole('button', { name: 'Request withdrawal' })).toBeInTheDocument(); @@ -171,7 +171,7 @@ describe('WithdrawalForm', () => { }); }); - expect(await screen.findByText('Depósito informado')).toBeInTheDocument(); + expect(await screen.findByText('Retiro solicitado')).toBeInTheDocument(); expect(screen.getByRole('button', { name: /Aceptar/i })).toBeInTheDocument(); }); @@ -184,8 +184,7 @@ describe('WithdrawalForm', () => { ); fireEvent.click(screen.getByLabelText('Total')); - const amountInput = screen.getByLabelText(/Monto/); - expect(amountInput).toBeDisabled(); + expect(screen.queryByLabelText(/Monto/)).not.toBeInTheDocument(); fireEvent.submit(container.querySelector('form')); @@ -199,7 +198,7 @@ describe('WithdrawalForm', () => { expect(createInvestorRequest).toHaveBeenCalled(); }); - expect(await screen.findByText('Depósito informado')).toBeInTheDocument(); + expect(await screen.findByText('Retiro solicitado')).toBeInTheDocument(); }); it('shows error when createInvestorRequest fails (after confirm)', async () => { diff --git a/src/i18n.js b/src/i18n.js index 03c6e48..3d7d304 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -205,7 +205,7 @@ const resources = { }, amount: { label: 'Monto', - placeholder: 'Ingresá el monto en USD', + placeholder: '1,000.00', }, validation: { invalidAmount: 'Ingresá un monto válido', @@ -237,6 +237,9 @@ const resources = { cash: 'Tu solicitud fue registrada correctamente. Las operaciones en efectivo se coordinan de forma personalizada. Un integrante de nuestro equipo se pondrá en contacto para coordinar el ingreso o retiro de los fondos.', international: 'Tu solicitud fue registrada correctamente. Las operaciones mediante transferencia internacional se coordinan de forma personalizada. Nuestro equipo se pondrá en contacto por correo electrónico para continuar con el proceso.', + withdrawalTitle: 'Retiro solicitado', + withdrawal: + 'La solicitud de retiro fue registrada correctamente.\n\nEl retiro será procesado en el próximo cierre operativo.\nUna vez completado, recibirás el comprobante correspondiente por correo electrónico.', }, }, history: { @@ -505,7 +508,7 @@ const resources = { }, amount: { label: 'Amount', - placeholder: 'Enter amount in USD', + placeholder: '1,000.00', }, validation: { invalidAmount: 'Enter a valid amount', @@ -537,6 +540,9 @@ const resources = { cash: 'Your request was registered successfully. Cash operations are coordinated personally. A member of our team will contact you to coordinate the deposit or withdrawal.', international: 'Your request was registered successfully. International transfers are coordinated personally. Our team will contact you by email to continue the process.', + withdrawalTitle: 'Withdrawal requested', + withdrawal: + 'The withdrawal request was registered successfully.\n\nThe withdrawal will be processed at the next operational close.\nOnce completed, you will receive the receipt by email.', }, }, history: { diff --git a/src/pages/WalletsPage.jsx b/src/pages/WalletsPage.jsx index 6eb5672..bbd1461 100644 --- a/src/pages/WalletsPage.jsx +++ b/src/pages/WalletsPage.jsx @@ -50,7 +50,6 @@ export const WalletsPage = () => {

{t('deposits.title')}

-

{t('deposits.subtitle')}