Display message for checking balance

This commit is contained in:
IshaVenikar 2025-02-11 12:44:33 +05:30
parent 588ba22ee6
commit 1839cdced9

View File

@ -52,6 +52,7 @@ const Configure = () => {
const [isPaymentDone, setIsPaymentDone] = useState(false); const [isPaymentDone, setIsPaymentDone] = useState(false);
const [isFrameVisible, setIsFrameVisible] = useState(false); const [isFrameVisible, setIsFrameVisible] = useState(false);
const [isAccountsDataReceived, setIsAccountsDataReceived] = useState(false); const [isAccountsDataReceived, setIsAccountsDataReceived] = useState(false);
const [balanceMessage, setBalanceMessage] = useState<string>();
const [searchParams] = useSearchParams(); const [searchParams] = useSearchParams();
const templateId = searchParams.get('templateId'); const templateId = searchParams.get('templateId');
@ -287,19 +288,19 @@ const Configure = () => {
if (templateId) { if (templateId) {
createFormData.option === 'Auction' createFormData.option === 'Auction'
? navigate( ? navigate(
`/${orgSlug}/projects/create/success/${projectId}?isAuction=true`, `/${orgSlug}/projects/create/success/${projectId}?isAuction=true`,
) )
: navigate( : navigate(
`/${orgSlug}/projects/create/template/deploy?projectId=${projectId}&templateId=${templateId}`, `/${orgSlug}/projects/create/template/deploy?projectId=${projectId}&templateId=${templateId}`,
); );
} else { } else {
createFormData.option === 'Auction' createFormData.option === 'Auction'
? navigate( ? navigate(
`/${orgSlug}/projects/create/success/${projectId}?isAuction=true`, `/${orgSlug}/projects/create/success/${projectId}?isAuction=true`,
) )
: navigate( : navigate(
`/${orgSlug}/projects/create/deploy?projectId=${projectId}`, `/${orgSlug}/projects/create/deploy?projectId=${projectId}`,
); );
} }
} catch (error: any) { } catch (error: any) {
toast({ toast({
@ -626,7 +627,7 @@ const Configure = () => {
(!selectedAccount || !isBalanceSufficient) ? ( (!selectedAccount || !isBalanceSufficient) ? (
<div className="flex items-center gap-4"> <div className="flex items-center gap-4">
<Button {...buttonSize} shape="default"> <Button {...buttonSize} shape="default" onClick={() => setBalanceMessage('Waiting for balance to get updated')}>
<a <a
href="https://store.laconic.com" href="https://store.laconic.com"
target="_blank" target="_blank"
@ -636,10 +637,14 @@ const Configure = () => {
</a> </a>
</Button> </Button>
<p className="text-gray-700 dark:text-gray-300"> <p className="text-gray-700 dark:text-gray-300">
{!selectedAccount ? 'No accounts found. Create a wallet.' : 'Insufficient funds.'} {balanceMessage !== undefined ? (
<div className="flex items-center gap-2 text-white">
<LoadingIcon className="animate-spin w-5 h-5" />
<p>{balanceMessage}</p>
</div>
) : !selectedAccount ? 'No accounts found. Create a wallet.' : 'Insufficient funds.'}
</p> </p>
</div> </div>
) : null ) : null
) : null} ) : null}
</div> </div>