From a4c6f0d32d12b1bc471a4d9dadf210da1c301b55 Mon Sep 17 00:00:00 2001 From: Helder Oliveira Date: Mon, 11 Jul 2022 18:06:13 +0100 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=F0=9F=90=9B=20rename=20kyasshu=20st?= =?UTF-8?q?art=20script=20cap=20canister=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .scripts/kyasshu/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scripts/kyasshu/start.sh b/.scripts/kyasshu/start.sh index 1cdccafe..d0e604bc 100755 --- a/.scripts/kyasshu/start.sh +++ b/.scripts/kyasshu/start.sh @@ -5,7 +5,7 @@ host=$1 if [[ -z $host || "$host" == "local" ]]; then - export CAP_ID=$(cd nft-marketplace/cap && dfx canister id ic-history-router) + export CAP_ID=$(cd nft-marketplace/cap && dfx canister id cap-router) export MARKETPLACE_CANISTER_ID=$(cd nft-marketplace && dfx canister id marketplace) export NFT_CANISTER_ID=$(cd nft-marketplace/crowns && dfx canister id crowns) export NFT_CANISTER_STANDARD='DIP721v2' From 5265d7ffec286d51dc94a84a7635e1657267e97f Mon Sep 17 00:00:00 2001 From: Helder Oliveira Date: Mon, 11 Jul 2022 18:11:36 +0100 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=F0=9F=90=9B=20start=20script=20cap?= =?UTF-8?q?=20router=20name=20(#442)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit chore: 🤖 ic-history-router is now cap-router --- .scripts/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scripts/start.sh b/.scripts/start.sh index 5d459650..c26162b6 100755 --- a/.scripts/start.sh +++ b/.scripts/start.sh @@ -10,7 +10,7 @@ if [[ $env == "development" ]]; then MKP_ID=$(cd nft-marketplace && dfx canister id marketplace) CROWNS_ID=$(cd nft-marketplace/crowns && dfx canister id crowns) WICP_ID=$(cd nft-marketplace/wicp && dfx canister id wicp) - CAP_ID=$(cd nft-marketplace/cap && dfx canister id ic-history-router) + CAP_ID=$(cd nft-marketplace/cap && dfx canister id cap-router) printf "🤖 Marketplace id (%s), CrownsId (%s), WicpId (%s), CapId (%s)\n" "$MKP_ID" "$CROWNS_ID" "$WICP_ID" "$CAP_ID" From d2a14388a32b118d730dfc6c5f21b8ba58e74109 Mon Sep 17 00:00:00 2001 From: prasanth kumar lalapeta <40259256+prasanthLalapeta@users.noreply.github.com> Date: Tue, 12 Jul 2022 18:16:35 +0530 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=F0=9F=90=9B=20show=20top=20offers?= =?UTF-8?q?=20and=20make=20offer=20action=20buttons=20in=20NFT=20details?= =?UTF-8?q?=20page=20(#445)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: reverted offers loading code back to original to show top offers and make offer --- .../core/accordions/offer-accordion.tsx | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/components/core/accordions/offer-accordion.tsx b/src/components/core/accordions/offer-accordion.tsx index acaec2c2..abde1447 100644 --- a/src/components/core/accordions/offer-accordion.tsx +++ b/src/components/core/accordions/offer-accordion.tsx @@ -80,6 +80,7 @@ const OnConnected = ({ }: ConnectedProps) => { const { id } = useParams(); const dispatch = useAppDispatch(); + const [loadingOffers, setLoadingOffers] = useState(true); const { principalId: plugPrincipalId } = usePlugStore(); const recentlyAcceptedOffers = useSelector( @@ -108,10 +109,6 @@ const OnConnected = ({ [id, tokenOffers, plugPrincipalId], ); - const offersLoaded = useSelector( - (state: RootState) => state.marketplace.offersLoaded, - ); - useEffect(() => { // TODO: handle the error gracefully when there is no id if (!id || !plugPrincipalId) return; @@ -120,6 +117,10 @@ const OnConnected = ({ marketplaceActions.getTokenOffers({ ownerTokenIdentifiers: [BigInt(id)], + onSuccess: () => { + setLoadingOffers(false); + }, + onFailure: () => { // TODO: handle failure messages }, @@ -149,7 +150,7 @@ const OnConnected = ({ @@ -159,11 +160,11 @@ const OnConnected = ({ isNFTListed={isListed} offerPrice={userMadeOffer?.price} isTriggerVisible={Boolean( - showNonOwnerButtons && !offersLoaded && userMadeOffer, + showNonOwnerButtons && !loadingOffers && userMadeOffer, )} /> - {showNonOwnerButtons && !offersLoaded && userMadeOffer && ( + {showNonOwnerButtons && !loadingOffers && userMadeOffer && ( (true); // TODO: On loading and awaiting for token offers response // should display a small loader in the place of price const [isAccordionOpen, setIsAccordionOpen] = useState(true); @@ -199,10 +201,6 @@ export const OfferAccordion = ({ string | undefined >(); - const offersLoaded = useSelector( - (state: RootState) => state.marketplace.offersLoaded, - ); - const { isConnected, principalId: plugPrincipal, @@ -226,6 +224,10 @@ export const OfferAccordion = ({ marketplaceActions.getTokenOffers({ ownerTokenIdentifiers: [BigInt(id as string)], + onSuccess: () => { + setLoadingOffers(false); + }, + onFailure: () => { // TODO: handle failure messages }, @@ -298,7 +300,7 @@ export const OfferAccordion = ({ {t('translation:accordions.offer.header.topOffer')} - {(!offersLoaded && ( + {(!loadingOffers && ( {(topOffer?.price && `${parseE8SAmountToWICP(