From dc0c28f685bcbc509cf99ba14681018c7e4efa70 Mon Sep 17 00:00:00 2001 From: RcleydsonR Date: Thu, 16 Feb 2023 22:04:01 -0300 Subject: [PATCH] Add spinner component to be reusable and add loading on network liquidity --- src/blockchain/events.ts | 3 +- .../ListingComponent/ListingComponent.vue | 18 +------- src/components/SearchComponent.vue | 32 +++++++++++++-- src/components/SpinnerComponent.vue | 41 +++++++++++++++++++ src/store/ether.ts | 4 ++ 5 files changed, 77 insertions(+), 21 deletions(-) create mode 100644 src/components/SpinnerComponent.vue diff --git a/src/blockchain/events.ts b/src/blockchain/events.ts index 64c896b..897e087 100644 --- a/src/blockchain/events.ts +++ b/src/blockchain/events.ts @@ -31,6 +31,7 @@ const getNetworksLiquidity = async (): Promise => { mumbaiProvider ); + etherStore.setLoadingNetworkLiquidity(true); const depositListGoerli = await getValidDeposits( getTokenAddress(NetworkEnum.ethereum), p2pContractGoerli @@ -42,8 +43,8 @@ const getNetworksLiquidity = async (): Promise => { ); etherStore.setDepositsValidListGoerli(depositListGoerli); - etherStore.setDepositsValidListMumbai(depositListMumbai); + etherStore.setLoadingNetworkLiquidity(false); }; const getValidDeposits = async ( diff --git a/src/components/ListingComponent/ListingComponent.vue b/src/components/ListingComponent/ListingComponent.vue index afa4a4b..4b35338 100644 --- a/src/components/ListingComponent/ListingComponent.vue +++ b/src/components/ListingComponent/ListingComponent.vue @@ -6,6 +6,7 @@ import type { WalletTransaction } from "@/model/WalletTransaction"; import { useEtherStore } from "@/store/ether"; import { storeToRefs } from "pinia"; import { ref, watch } from "vue"; +import SpinnerComponent from "../SpinnerComponent.vue"; const etherStore = useEtherStore(); @@ -111,22 +112,7 @@ showInitialItems();