From 03c1e4ecece62b59f6930175003041d793bce000 Mon Sep 17 00:00:00 2001 From: Sherkhan Azimov Date: Sun, 5 May 2024 23:19:20 +0200 Subject: [PATCH 1/5] fix: search artist focus --- .../react-app/src/components/AddressInput.js | 39 +++---------------- 1 file changed, 6 insertions(+), 33 deletions(-) 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) From 094aaea8f46c17dcc5fd4079cca07cb5ddffec31 Mon Sep 17 00:00:00 2001 From: Sherkhan Azimov Date: Mon, 6 May 2024 09:03:25 +0200 Subject: [PATCH 2/5] fix: stats page --- packages/react-app/src/Stats.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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) { /> Date: Wed, 8 May 2024 15:48:36 +0200 Subject: [PATCH 3/5] fix: borders for inks display --- packages/react-app/src/ViewInk.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/react-app/src/ViewInk.js b/packages/react-app/src/ViewInk.js index b93da0a..2f4412b 100644 --- a/packages/react-app/src/ViewInk.js +++ b/packages/react-app/src/ViewInk.js @@ -953,8 +953,6 @@ export default function ViewInk(props) { width: size[0], height: size[0], margin: "0 auto", - border: "1px solid #999999", - boxShadow: "2px 2px 8px #AAAAAA" }} >
From d5dee64aeda91e3ece5ffcddafece19135a5a817 Mon Sep 17 00:00:00 2001 From: Sherkhan Azimov Date: Wed, 8 May 2024 17:05:46 +0200 Subject: [PATCH 4/5] fix: add outer border for inks --- packages/react-app/src/ViewInk.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-app/src/ViewInk.js b/packages/react-app/src/ViewInk.js index 2f4412b..e5f5cea 100644 --- a/packages/react-app/src/ViewInk.js +++ b/packages/react-app/src/ViewInk.js @@ -953,6 +953,7 @@ export default function ViewInk(props) { width: size[0], height: size[0], margin: "0 auto", + outline: "3px solid #999999", }} >
From 1215e22a8ee58d4b785ab02d5293feff99126fd4 Mon Sep 17 00:00:00 2001 From: Sherkhan Azimov Date: Wed, 8 May 2024 20:38:25 +0200 Subject: [PATCH 5/5] fix: loading inks --- packages/react-app/src/Artist.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; };