diff --git a/README.md b/README.md index cee784b..6bed59c 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,11 @@ Credits -Root cid: bafybeibgz3dg6yt56ccosginrgrrchrcasu2kg4ueqcdwfxln4x4tox5he -Gateway url: https://bafybeibgz3dg6yt56ccosginrgrrchrcasu2kg4ueqcdwfxln4x4tox5he.ipfs.dweb.link + -Test deploy (with initialized 5 ethers): -Root cid: bafybeiafhlsrejnnsngamewtj5ev4fwbvujfbgehjvkoy7wwexb6nrrhwi -Gateway url: https://bafybeiafhlsrejnnsngamewtj5ev4fwbvujfbgehjvkoy7wwexb6nrrhwi.ipfs.dweb.link \ No newline at end of file + + +Root cid: bafybeiff6dp5minmqwe5y6b5outyeo7lhpjsgtjjx5iv3373wtrnrrbhdi +Gateway url: https://bafybeiff6dp5minmqwe5y6b5outyeo7lhpjsgtjjx5iv3373wtrnrrbhdi.ipfs.dweb.link diff --git a/src/views/Dashboard/Portfolio/index.tsx b/src/views/Dashboard/Portfolio/index.tsx index d1c6fa5..13ca6a1 100644 --- a/src/views/Dashboard/Portfolio/index.tsx +++ b/src/views/Dashboard/Portfolio/index.tsx @@ -5,6 +5,9 @@ import { useColorModeValue, Image, Spinner, + Box, + Text, + Button, } from "@chakra-ui/react"; import { useWeb3React } from "@web3-react/core"; import { WalletIcon } from "components/Icons/Icons"; @@ -20,6 +23,7 @@ import { import ReactApexChart from "react-apexcharts"; import { lineChartOptions } from "variables/charts"; import Holdings from "./components/Holdings"; +import { useHistory } from "react-router-dom"; export default function Dashboard() { const iconBoxInside = useColorModeValue("white", "white"); @@ -27,6 +31,8 @@ export default function Dashboard() { const walletBalances = useBalances(account); const priceHistory = usePriceHistory("ethereum"); const tokenTxs = useTokenTxHistory(account); + const history = useHistory(); + const errors = [ walletBalances.error, priceHistory.error, @@ -38,7 +44,20 @@ export default function Dashboard() { tokenTxs.response, ].filter((e) => !e); let initScreen = null; - if (!active || !account) initScreen =
connect wallet
; + if (!active || !account) + initScreen = ( + + No connected wallet found. + + + + + ); else if (errors.length > 0) initScreen =
Error: {errors[0]}
; else if (loading.length > 0) initScreen = ; if (initScreen) { @@ -49,7 +68,9 @@ export default function Dashboard() { ); } const { ETH, tokens = [] } = walletBalances.response!; - const txs = Array.isArray(tokenTxs.response?.result) ? tokenTxs.response!.result : []; + const txs = Array.isArray(tokenTxs.response?.result) + ? tokenTxs.response!.result + : []; const listTimeWindow = "diff7d"; const tokenDetails = tokens.map((t) => { const balance = t.balance / Math.pow(10, Number(t.tokenInfo.decimals)); @@ -94,7 +115,7 @@ export default function Dashboard() { currency: "USD", }); const totalFunds = tokenDetails.reduce((acc, e) => acc + e.value, 0); - tokenDetails.forEach(e => e.weight = e.value/totalFunds); + tokenDetails.forEach((e) => (e.weight = e.value / totalFunds)); return ( } />