diff --git a/packages/react-app/src/Artist.js b/packages/react-app/src/Artist.js index d56e6f3..a956001 100644 --- a/packages/react-app/src/Artist.js +++ b/packages/react-app/src/Artist.js @@ -187,7 +187,7 @@ export default function Artist(props) { const data = await response.json(); data.image = data.image.replace( "https://ipfs.io/ipfs/", - "https://nifty-ink.mypinata.cloud/ipfs/" + "https://gateway.nifty.ink:42069/ipfs/" ); return data; }; diff --git a/packages/react-app/src/Stats.js b/packages/react-app/src/Stats.js index 83ef3de..0eec77f 100644 --- a/packages/react-app/src/Stats.js +++ b/packages/react-app/src/Stats.js @@ -38,7 +38,7 @@ export default function Stats(props) { const [dailyTotals, setDailyTotals] = useState(null) const [period, setPeriod] = useState("month") const [totalData, setTotalData] = useState({}) - const [startingDate, setStartingDate] = useState(dailyDate) + const [startingDate, setStartingDate] = useState(dayjs().utc().startOf("day").subtract(28, "day").unix()) const handleChartHover = (hoverLoc, activePoint) => { @@ -65,20 +65,20 @@ export default function Stats(props) { console.log("before", totalDataBefore.totals) console.log("now", totalDataNow.totals) setTotalData({ - tokens: totalDataNow.totals[0].tokens - totalDataBefore.totals[0].tokens, - inks: totalDataNow.totals[0].inks - totalDataBefore.totals[0].inks, - saleValue: ethers.utils.formatEther(totalDataNow.totals[0].saleValue) - ethers.utils.formatEther(totalDataBefore.totals[0].saleValue), - sales: totalDataNow.totals[0].sales - totalDataBefore.totals[0].sales, - upgrades: totalDataNow.totals[0].upgrades - totalDataBefore.totals[0].upgrades, - users: totalDataNow.totals[0].users - totalDataBefore.totals[0].users, - artists: totalDataNow.totals[0].artists - totalDataBefore.totals[0].artists + tokens: totalDataNow.totals[0].tokens - (totalDataBefore?.totals[0]?.tokens || 0), + inks: totalDataNow.totals[0].inks - (totalDataBefore?.totals[0]?.inks||0), + saleValue: ethers.utils.formatEther(totalDataNow?.totals[0]?.saleValue) - (ethers.utils.formatEther(totalDataBefore?.totals[0]?.saleValue || 0)), + sales: totalDataNow.totals[0].sales - (totalDataBefore?.totals[0]?.sales || 0), + upgrades: totalDataNow.totals[0].upgrades - (totalDataBefore?.totals[0]?.upgrades|| 0), + users: totalDataNow.totals[0].users - (totalDataBefore?.totals[0]?.users || 0), + artists: totalDataNow.totals[0].artists - (totalDataBefore?.totals[0]?.artists || 0) }) } }, [totalDataBefore, totalDataNow]) useEffect(() => { if (period == "month") { - setStartingDate(dayjs().utc().startOf("day").subtract(1, "month").unix()) + setStartingDate(dayjs().utc().startOf("day").subtract(28, "day").unix()) } else if (period == "week") { setStartingDate(dayjs().utc().startOf("day").subtract(1, "week").unix()) } else if (period == "year") { @@ -221,7 +221,7 @@ export default function Stats(props) { />
diff --git a/packages/react-app/src/components/AddressInput.js b/packages/react-app/src/components/AddressInput.js index b9f90e0..783a58f 100644 --- a/packages/react-app/src/components/AddressInput.js +++ b/packages/react-app/src/components/AddressInput.js @@ -6,41 +6,11 @@ import { Input, Badge } from 'antd'; export default function AddressInput(props) { - const [ ens, setEns ] = useState(0) const [ value, setValue ] = useState() + const [isAddressFound, setIsAddressFound] = useState(false); const currentValue = typeof props.value != "undefined"?props.value:value - useEffect(()=>{ - setEns("") - if(currentValue && props.ensProvider){ - async function getEns(){ - let newEns - try{ - console.log("trying reverse ens",newEns) - - newEns = await props.ensProvider.lookupAddress(currentValue) - console.log("setting ens",newEns) - setEns(newEns) - }catch(e){} - console.log("checking resolve") - if( currentValue.indexOf(".eth")>0 || currentValue.indexOf(".xyz")>0 ){ - try{ - console.log("resolving") - let possibleAddress = await props.ensProvider.resolveName(currentValue); - console.log("GOT:L",possibleAddress) - if(possibleAddress){ - setEns(currentValue) - props.onChange(possibleAddress) - } - }catch(e){} - } - } - getEns() - } - },[props.value]) - - const [ scan, setScan ] = useState(false) let scannerButton = ( @@ -62,8 +32,11 @@ export default function AddressInput(props) { let possibleAddress = await props.ensProvider.resolveName(address); if(possibleAddress){ address = possibleAddress + setIsAddressFound(true); } }catch(e){} + } else { + setIsAddressFound(true); } setValue(address) if(typeof props.onChange == "function") { props.onChange(address) } @@ -105,10 +78,10 @@ export default function AddressInput(props) {
{scanner} } - value={ens?ens:currentValue} + value={currentValue} addonAfter={scannerButton} onChange={(e)=>{ updateAddress(e.target.value)