From 9b307193c400cfca43c3231e6a2010285d2c2d50 Mon Sep 17 00:00:00 2001 From: dev-fani Date: Tue, 30 Jun 2026 10:51:18 +0100 Subject: [PATCH] feat: redirect to pool detail page after creation - After submitSignedXdr() succeeds, redirect to /pools/{poolId} - Removed SuccessScreen component and submitted state - Added parseApiError import for error handling - Pool ID is captured from createPool() response and used for redirect Resolves #723 --- nevo_frontend/app/pools/new/page.tsx | 31 +++------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/nevo_frontend/app/pools/new/page.tsx b/nevo_frontend/app/pools/new/page.tsx index 9919447..f55dd0e 100644 --- a/nevo_frontend/app/pools/new/page.tsx +++ b/nevo_frontend/app/pools/new/page.tsx @@ -7,6 +7,7 @@ import { createPool, submitSignedXdr, ApiError } from '@/lib/api-client'; import { signTransaction } from '@stellar/freighter-api'; import { contractService } from '@/lib/contract-service'; import { useWalletStore } from '@/src/store/walletStore'; +import { parseApiError } from '@/lib/errors'; import { validateFormData, @@ -130,7 +131,6 @@ function CreatePoolPageContent() { const [submitStep, setSubmitStep] = useState< 'idle' | 'creating' | 'signing' | 'submitting' >('idle'); - const [submitted, setSubmitted] = useState(false); const [imageFile, setImageFile] = useState(null); const [imagePreviewUrl, setImagePreviewUrl] = useState(''); const [cropPreviewUrl, setCropPreviewUrl] = useState(''); @@ -355,7 +355,8 @@ function CreatePoolPageContent() { setSubmitStep('submitting'); await submitSignedXdr(signedResult.signedTxXdr); - setSubmitted(true); + // Redirect to the newly created pool's page after successful submission + router.push(`/pools/${createPoolResult.id}`); } catch (error) { setErrors({ submit: parseApiError(error) }); } finally { @@ -364,10 +365,6 @@ function CreatePoolPageContent() { } } - if (submitted) { - return router.push('/dashboard')} />; - } - const tagList = form.tags .split(',') .map((t) => t.trim()) @@ -951,28 +948,6 @@ function Step3({ ); } -/* ── Success screen ───────────────────────────────────────────────────────── */ - -function SuccessScreen({ onGoToDashboard }: { onGoToDashboard: () => void }) { - return ( -
-
-
- -
-

Pool Created!

-

- Your donation pool has been created successfully. Share it with your - community to start receiving contributions. -

- -
-
- ); -} - /* ── Field wrapper ────────────────────────────────────────────────────────── */ interface FieldProps {