From cc3d7f708f44a41af73dc564f5bbefd6ade453de Mon Sep 17 00:00:00 2001 From: IshaVenikar <145848618+IshaVenikar@users.noreply.github.com> Date: Thu, 28 Mar 2024 13:36:14 +0530 Subject: [PATCH] Add spinner for tx after being approved (#67) * Add spinner for tx * Change text color --- src/screens/ApproveTransaction.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/screens/ApproveTransaction.tsx b/src/screens/ApproveTransaction.tsx index e031604..8935c8a 100644 --- a/src/screens/ApproveTransaction.tsx +++ b/src/screens/ApproveTransaction.tsx @@ -49,6 +49,7 @@ const ApproveTransaction = ({ route }: SignRequestProps) => { const [account, setAccount] = useState(); const [isLoading, setIsLoading] = useState(true); const [balance, setBalance] = useState(''); + const [isTxLoading, setIsTxLoading] = useState(false); const [cosmosStargateClient, setCosmosStargateClient] = useState(); @@ -96,6 +97,7 @@ const ApproveTransaction = ({ route }: SignRequestProps) => { }, [retrieveData, transaction]); const acceptRequestHandler = async () => { + setIsTxLoading(true); if (!account) { throw new Error('account not found'); } @@ -110,6 +112,7 @@ const ApproveTransaction = ({ route }: SignRequestProps) => { const { topic } = requestEvent; await web3wallet!.respondSessionRequest({ topic, response }); + setIsTxLoading(false); navigation.navigate('Laconic'); }; @@ -254,8 +257,11 @@ const ApproveTransaction = ({ route }: SignRequestProps) => { )} -