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 {