From 52b6f2678d07cab7c9e249c597a9e33ea81db0c6 Mon Sep 17 00:00:00 2001 From: Bhaskar Singh Date: Wed, 17 Mar 2021 10:41:51 +0530 Subject: [PATCH 1/8] fix: don't log localhost errors - sentry. (#285) --- gatsby-config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/gatsby-config.js b/gatsby-config.js index f050e037..2d8bdc93 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -132,6 +132,7 @@ module.exports = { options: { dsn: "https://d2e5097585b0401aab888bfa8a8570ac@o551788.ingest.sentry.io/5675666", sampleRate: 0.7, + denyUrls: ["localhost:8000"] }, }, ], From 6f59316f97210fd8cc19bb37634a0bb518ed9d23 Mon Sep 17 00:00:00 2001 From: Bhaskar Singh Date: Wed, 17 Mar 2021 11:40:23 +0530 Subject: [PATCH 2/8] fix: default to indexer load size --- src/utils/indexer.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/utils/indexer.js b/src/utils/indexer.js index 4d41ae7f..82557e1d 100644 --- a/src/utils/indexer.js +++ b/src/utils/indexer.js @@ -193,13 +193,13 @@ export const getNftInfoByXTZAddress = async (address = '') => { const result = await response.json(); const tokens = result[0].children.find(elm => elm.name === 'ledger'); - const ledgerMetadata = await fetch( - `https://api.better-call.dev/v1/bigmap/${INDEXER_NETWORK}/${tokens.value}`, - ); - const ledgerMetadataJSON = await ledgerMetadata.json(); + // const ledgerMetadata = await fetch( + // `https://api.better-call.dev/v1/bigmap/${INDEXER_NETWORK}/${tokens.value}`, + // ); + // const ledgerMetadataJSON = await ledgerMetadata.json(); const tk = await fetch( - `https://api.better-call.dev/v1/bigmap/${INDEXER_NETWORK}/${tokens.value}/keys?size=${ledgerMetadataJSON.active_keys}`, + `https://api.better-call.dev/v1/bigmap/${INDEXER_NETWORK}/${tokens.value}/keys`, ); const ledger = await tk.json(); @@ -248,13 +248,13 @@ const getAllTokenHolders = async () => { const result = await response.json(); const tokens = result[0].children.find(elm => elm.name === 'ledger'); - const ledgerMetadata = await fetch( - `https://api.better-call.dev/v1/bigmap/${INDEXER_NETWORK}/${tokens.value}`, - ); - const ledgerMetadataJSON = await ledgerMetadata.json(); + // const ledgerMetadata = await fetch( + // `https://api.better-call.dev/v1/bigmap/${INDEXER_NETWORK}/${tokens.value}`, + // ); + // const ledgerMetadataJSON = await ledgerMetadata.json(); const tk = await fetch( - `https://api.better-call.dev/v1/bigmap/${INDEXER_NETWORK}/${tokens.value}/keys?size=${ledgerMetadataJSON.active_keys}`, + `https://api.better-call.dev/v1/bigmap/${INDEXER_NETWORK}/${tokens.value}/keys`, ); const ledger = await tk.json(); From 78dc6d5d5cca7e5bfb52042b6725c91c667128e9 Mon Sep 17 00:00:00 2001 From: Bhaskar Singh Date: Wed, 17 Mar 2021 12:05:25 +0530 Subject: [PATCH 3/8] temp-fix: show latest 10 bots --- src/utils/indexer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/indexer.js b/src/utils/indexer.js index 82557e1d..40788859 100644 --- a/src/utils/indexer.js +++ b/src/utils/indexer.js @@ -30,7 +30,7 @@ export const getAllNFTsMetadata = async () => { const tokensMetataDataJSON = await tokensMetataData.json(); const tk = await fetch( - `https://api.better-call.dev/v1/bigmap/${INDEXER_NETWORK}/${tokens.value}/keys?size=${tokensMetataDataJSON.active_keys}`, + `https://api.better-call.dev/v1/bigmap/${INDEXER_NETWORK}/${tokens.value}/keys`, ); const all_tokens = await tk.json(); @@ -69,7 +69,7 @@ export const nftOnOffer = async () => { const offerMetadataJSON = await offerMetadata.json(); const tk = await fetch( - `https://api.better-call.dev/v1/bigmap/${INDEXER_NETWORK}/${tokens.value}/keys?size=${offerMetadataJSON.active_keys}`, + `https://api.better-call.dev/v1/bigmap/${INDEXER_NETWORK}/${tokens.value}/keys`, ); const offers = await tk.json(); From b5991774ebd07cb46b90d5549a89094eb0045b5e Mon Sep 17 00:00:00 2001 From: manangouhari <31039184+manangouhari@users.noreply.github.com> Date: Thu, 18 Mar 2021 11:40:06 +0530 Subject: [PATCH 4/8] feat: refreshing /claim-transaction persists state. (#291) * feat: refreshing /claim-transaction persists state. * chore: cleaned up console.log --- src/pages/tezos/claim-transaction.js | 33 ++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/src/pages/tezos/claim-transaction.js b/src/pages/tezos/claim-transaction.js index 0f73204f..54aba7f7 100644 --- a/src/pages/tezos/claim-transaction.js +++ b/src/pages/tezos/claim-transaction.js @@ -148,9 +148,11 @@ function Transaction({ location }) { const [opHash, setOpHash] = useState(null); const [networkFeeEstimate, setNetworkFeeEstimate] = useState(0); // const xtzPrice = location.state ? location.state.xtzPrice : null; - const modelURI = location.state ? location.state.modelURI : null; - const jsonURI = location.state ? location.state.jsonURI : null; - console.log(location.state); + // const modelURI = location.state ? location.state.modelURI : null; + // const jsonURI = location.state ? location.state.jsonURI : null; + const [modelURI, setModelURI] = useState(); + const [jsonURI, setJsonURI] = useState(); + const { width, height } = useWindowSize(); const [xtzPrice, updateXtzPrice] = useState(null); @@ -161,6 +163,29 @@ function Transaction({ location }) { const [copyLink, setCopyLink] = useState(false); const [claimButtonDisabled, setClaimButtonDisabledStatus] = useState(true); + useEffect(() => { + if (typeof window === `undefined`) return; + if (location.state == null) { + const stateJSON = localStorage.getItem('claim-transaction-state'); + + if (stateJSON != null) { + const state = JSON.parse(stateJSON); + setModelURI(state.modelURI); + setJsonURI(state.jsonURI); + } + } else { + localStorage.setItem( + 'claim-transaction-state', + JSON.stringify({ + modelURI: location.state.modelURI, + jsonURI: location.state.jsonURI, + }), + ); + setModelURI(location.state.modelURI); + setJsonURI(location.state.jsonURI); + } + }, []); + const ErrorModal = () => { return (
{ try { const result = await getXTZPrice(); - console.log(result); + updateXtzPrice(result); } catch (error) { console.log(error); From 588053db71915db7758b83972bc792083e4d3c29 Mon Sep 17 00:00:00 2001 From: Manan Gouhari Date: Thu, 18 Mar 2021 11:51:37 +0530 Subject: [PATCH 5/8] Stepper ui fixed for 'claim-transaction' page. --- src/pages/tezos/claim-transaction.js | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/pages/tezos/claim-transaction.js b/src/pages/tezos/claim-transaction.js index 0f73204f..172b7388 100644 --- a/src/pages/tezos/claim-transaction.js +++ b/src/pages/tezos/claim-transaction.js @@ -30,10 +30,10 @@ import { MichelsonMap } from '@taquito/taquito'; import { trackEvent } from 'src/utils/analytics'; -const Steppers = ({ number, name, clickEvent, tick = false }) => { +const Steppers = ({ number, name, clickEvent, step, tick = false }) => { return (
-
+
{tick ? (
{
) : ( -
+
{number}
)} @@ -280,26 +284,37 @@ function Transaction({ location }) { number="1" name="Confirm Claim" tick={step >= 2} + step={step} clickEvent={e => { e.preventDefault(); // setStep(1); }} /> -
+
{ e.preventDefault(); // setStep(2); }} /> -
+
{ e.preventDefault(); // setStep(3); From af393877df709274fc1565d8bbc2974189ef40a5 Mon Sep 17 00:00:00 2001 From: Manan Gouhari Date: Thu, 18 Mar 2021 11:57:51 +0530 Subject: [PATCH 6/8] Stepper ui fixed 'transaction' page --- src/pages/tezos/claim-transaction.js | 2 +- src/pages/tezos/transaction.js | 23 +++++++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/pages/tezos/claim-transaction.js b/src/pages/tezos/claim-transaction.js index 172b7388..c118dbfd 100644 --- a/src/pages/tezos/claim-transaction.js +++ b/src/pages/tezos/claim-transaction.js @@ -292,7 +292,7 @@ function Transaction({ location }) { />
= 2 ? 'border-primary-600' : 'border-base-600' }`} >
{ +const Steppers = ({ number, name, clickEvent, step, tick = false }) => { return (
@@ -33,7 +33,11 @@ const Steppers = ({ number, name, clickEvent, tick = false }) => {
) : ( -
+
{number}
)} @@ -236,26 +240,37 @@ function Transaction({ location }) { number="1" name="Confirm Claim" tick={step >= 2} + step={step} clickEvent={e => { e.preventDefault(); // setStep(1); }} /> -
+
= 2 ? 'border-primary-600' : 'border-base-600' + }`} + >
{ e.preventDefault(); // setStep(2); }} /> -
+
{ e.preventDefault(); // setStep(3); From ff2964ae977e9559a9ab940f6765928e4f689ce0 Mon Sep 17 00:00:00 2001 From: Bhaskar Singh Date: Thu, 18 Mar 2021 12:43:12 +0530 Subject: [PATCH 7/8] Measure improve (#290) * closes #127 * feat: update amplitude event name taxonomy present-tense verb + object syntax with spaces and all in lowercase for clarity on when the event triggers closes #102 --- src/html.js | 4 ++++ src/pages/tezos/academy/index.js | 2 +- src/pages/tezos/claim-transaction.js | 2 +- src/pages/tezos/customizebot.js | 2 +- src/templates/chapter-new.js | 4 ++-- src/templates/chapter.js | 4 ++-- src/templates/chapterWithLiveEditor.js | 4 ++-- src/templates/chapterWithLiveEditorOld.js | 4 ++-- src/templates/components/chapter/CodingInterface.js | 2 +- src/templates/overview.js | 2 +- 10 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/html.js b/src/html.js index 51066825..fff5ee80 100644 --- a/src/html.js +++ b/src/html.js @@ -11,6 +11,10 @@ export default function HTML(props) { name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> +