From a59858d99133f8efe8b4e9420becca5e13323747 Mon Sep 17 00:00:00 2001 From: Francisco Pessano Date: Thu, 3 Feb 2022 20:38:18 -0300 Subject: [PATCH] Console.logs removed --- src/components/Crypto/Crypto.jsx | 4 ---- src/components/CryptoGallery/CryptoGallery.jsx | 15 --------------- .../CryptoGallery/CryptoGalleryItem.jsx | 2 +- 3 files changed, 1 insertion(+), 20 deletions(-) diff --git a/src/components/Crypto/Crypto.jsx b/src/components/Crypto/Crypto.jsx index cc816fe..492e33b 100644 --- a/src/components/Crypto/Crypto.jsx +++ b/src/components/Crypto/Crypto.jsx @@ -138,8 +138,6 @@ const Crypto = () => { days -= 1 } - console.log(days) - try { const requestData = await fetch(`https://api.coingecko.com/api/v3/coins/${cryptoID}/market_chart?vs_currency=usd&days=${days}&interval=daily`) @@ -170,7 +168,6 @@ const Crypto = () => { const effectHandler = async () => { const data = await getCryptoData() - console.log(data); const cryptoPricesPrevious = {} cryptoPricesPrevious.week = await getCryptoPrice(7) @@ -186,7 +183,6 @@ const Crypto = () => { datesPrevious.year = getDates(365) setDates(datesPrevious) - console.log(dates); const maxValue = Math.max(...cryptoPricesPrevious.year) const minValue = Math.min(...cryptoPricesPrevious.year) diff --git a/src/components/CryptoGallery/CryptoGallery.jsx b/src/components/CryptoGallery/CryptoGallery.jsx index 183a88e..090c518 100644 --- a/src/components/CryptoGallery/CryptoGallery.jsx +++ b/src/components/CryptoGallery/CryptoGallery.jsx @@ -79,7 +79,6 @@ const CryptoGallery = ({setLoading, setLoadingURL, loading}) => { let data = await fetch("https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&per_page=30&order=gecko_desc") data = await data.json() - console.log(data) return data } catch (error) { @@ -92,11 +91,8 @@ const CryptoGallery = ({setLoading, setLoadingURL, loading}) => { try { - console.log(data.id) let requestData = await fetch(`https://api.coingecko.com/api/v3/coins/${data.id}/market_chart?vs_currency=usd&days=6&interval=daily`) requestData = await requestData.json() - - console.log(requestData) return requestData.prices @@ -128,7 +124,6 @@ const CryptoGallery = ({setLoading, setLoadingURL, loading}) => { const lastDayPrices = localStorage.getItem('lastDayPrices') const actualDay = moment().format('DD-MM-YYYY') - console.log(actualDay) setDates(generateArrayOfDates()) // In the case the las day prices are today, just restore them from Local Storage @@ -136,16 +131,12 @@ const CryptoGallery = ({setLoading, setLoadingURL, loading}) => { const prices = JSON.parse(localStorage.getItem('prices')) - console.log('Prices accessed from LocalStorage') - console.log(lastDayPrices) - setCryptosPrices(prices) return } // If not, extract all them from the API - console.log('Prices accessed from API') let cryptoPricesCopy = [] @@ -160,7 +151,6 @@ const CryptoGallery = ({setLoading, setLoadingURL, loading}) => { setLoadingURL(object.image) let requestData = await getCryptoPrices(object) - console.log(requestData) requestData = requestData.map(arr => { @@ -168,7 +158,6 @@ const CryptoGallery = ({setLoading, setLoadingURL, loading}) => { }) - console.log(requestData) let objectResult = {} objectResult[object.id] = {} @@ -177,7 +166,6 @@ const CryptoGallery = ({setLoading, setLoadingURL, loading}) => { }) await setCryptosPrices(await cryptoPricesCopy) - console.log(await cryptosPrices) } React.useEffect(() => { @@ -189,15 +177,12 @@ const CryptoGallery = ({setLoading, setLoadingURL, loading}) => { React.useEffect(() => { - console.log(cryptosPrices) - //Once prices are loaded into the state... if (cryptosPrices) { //Almacenate prices on LocalStorage const jsonString = JSON.stringify(cryptosPrices) localStorage.setItem('prices', jsonString) - console.log(JSON.parse(localStorage.getItem('prices'))) //Almacenate actual day on LocalStorage const actualDay = moment().format('DD-MM-YYYY') diff --git a/src/components/CryptoGallery/CryptoGalleryItem.jsx b/src/components/CryptoGallery/CryptoGalleryItem.jsx index 13db807..f50d24d 100644 --- a/src/components/CryptoGallery/CryptoGalleryItem.jsx +++ b/src/components/CryptoGallery/CryptoGalleryItem.jsx @@ -29,7 +29,7 @@ const CryptoGalleryItem = ({CryptoStyles, data, cryptoPrices, dates, index, cryp React.useEffect(() => { - // console.log(cryptoPrices[data.id].prices) + // (cryptoPrices[data.id].prices) if (!cryptoPrices[data.id]) {