From 1839cdced97b952b7fd6fb3a843cc4543ae1e911 Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Tue, 11 Feb 2025 12:44:33 +0530 Subject: [PATCH] Display message for checking balance --- .../components/projects/create/Configure.tsx | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/packages/frontend/src/components/projects/create/Configure.tsx b/packages/frontend/src/components/projects/create/Configure.tsx index 35ca1f44..00a65949 100644 --- a/packages/frontend/src/components/projects/create/Configure.tsx +++ b/packages/frontend/src/components/projects/create/Configure.tsx @@ -52,6 +52,7 @@ const Configure = () => { const [isPaymentDone, setIsPaymentDone] = useState(false); const [isFrameVisible, setIsFrameVisible] = useState(false); const [isAccountsDataReceived, setIsAccountsDataReceived] = useState(false); + const [balanceMessage, setBalanceMessage] = useState(); const [searchParams] = useSearchParams(); const templateId = searchParams.get('templateId'); @@ -287,19 +288,19 @@ const Configure = () => { if (templateId) { createFormData.option === 'Auction' ? navigate( - `/${orgSlug}/projects/create/success/${projectId}?isAuction=true`, - ) + `/${orgSlug}/projects/create/success/${projectId}?isAuction=true`, + ) : navigate( - `/${orgSlug}/projects/create/template/deploy?projectId=${projectId}&templateId=${templateId}`, - ); + `/${orgSlug}/projects/create/template/deploy?projectId=${projectId}&templateId=${templateId}`, + ); } else { createFormData.option === 'Auction' ? navigate( - `/${orgSlug}/projects/create/success/${projectId}?isAuction=true`, - ) + `/${orgSlug}/projects/create/success/${projectId}?isAuction=true`, + ) : navigate( - `/${orgSlug}/projects/create/deploy?projectId=${projectId}`, - ); + `/${orgSlug}/projects/create/deploy?projectId=${projectId}`, + ); } } catch (error: any) { toast({ @@ -626,7 +627,7 @@ const Configure = () => { (!selectedAccount || !isBalanceSufficient) ? (
-

- {!selectedAccount ? 'No accounts found. Create a wallet.' : 'Insufficient funds.'} + {balanceMessage !== undefined ? ( +

+ +

{balanceMessage}

+
+ ) : !selectedAccount ? 'No accounts found. Create a wallet.' : 'Insufficient funds.'}

- ) : null ) : null}