From 85c63382a82fd9dcfe72f508bd334ddeb3b74cf5 Mon Sep 17 00:00:00 2001 From: samepant Date: Thu, 18 Jan 2024 18:07:47 -0500 Subject: [PATCH] fix links, link search results --- frontend/src/components/NFTGridItem/index.tsx | 2 +- frontend/src/components/NFTItem/index.tsx | 2 +- .../components/Search/SearchResults/index.tsx | 26 ++++++++++++++----- frontend/src/hooks/useTokenBalances.ts | 2 +- frontend/src/hooks/useTokenMetadata.ts | 2 +- frontend/src/router.tsx | 2 +- 6 files changed, 25 insertions(+), 11 deletions(-) diff --git a/frontend/src/components/NFTGridItem/index.tsx b/frontend/src/components/NFTGridItem/index.tsx index 8a33c35..4fab867 100644 --- a/frontend/src/components/NFTGridItem/index.tsx +++ b/frontend/src/components/NFTGridItem/index.tsx @@ -37,7 +37,7 @@ const NFTGridItem: React.FC = ({ nft, chainId }) => {

{name || "..."} diff --git a/frontend/src/components/NFTItem/index.tsx b/frontend/src/components/NFTItem/index.tsx index 30fce9c..34b37ae 100644 --- a/frontend/src/components/NFTItem/index.tsx +++ b/frontend/src/components/NFTItem/index.tsx @@ -33,8 +33,8 @@ const NFTItem: React.FC = ({ nft, chainId }) => { chainId, }) + console.log(data) const mechBalances = data ? [data.native, ...data.erc20s] : [] - const { deployed } = useDeployMech(getNFTContext(nft), chainId) const name = nft.name || nft.metadata?.name || "..." return ( diff --git a/frontend/src/components/Search/SearchResults/index.tsx b/frontend/src/components/Search/SearchResults/index.tsx index 0744c78..fede392 100644 --- a/frontend/src/components/Search/SearchResults/index.tsx +++ b/frontend/src/components/Search/SearchResults/index.tsx @@ -18,8 +18,10 @@ const SearchResults = ({ results }: { results: SearchResult[] }) => {

  • Deployed Mech

  • @@ -30,8 +32,13 @@ const SearchResults = ({ results }: { results: SearchResult[] }) => {
  • NFT Collection

  • @@ -42,8 +49,15 @@ const SearchResults = ({ results }: { results: SearchResult[] }) => {
  • Account

  • diff --git a/frontend/src/hooks/useTokenBalances.ts b/frontend/src/hooks/useTokenBalances.ts index ce8ebe8..0867f5b 100644 --- a/frontend/src/hooks/useTokenBalances.ts +++ b/frontend/src/hooks/useTokenBalances.ts @@ -36,7 +36,7 @@ const useTokenBalances = ({ accountAddress, chainId }: Props) => { throw new Error("ERC20 request failed") } const erc20Json = await erc20Res.json() - const erc20Data = erc20Json.result as MoralisFungible[] + const erc20Data = erc20Json as MoralisFungible[] // get native balance const nativeRes = await fetch( diff --git a/frontend/src/hooks/useTokenMetadata.ts b/frontend/src/hooks/useTokenMetadata.ts index 9ef7ccc..14b5679 100644 --- a/frontend/src/hooks/useTokenMetadata.ts +++ b/frontend/src/hooks/useTokenMetadata.ts @@ -21,7 +21,7 @@ const useNFTMetadata = ({ tokenAddress, tokenId, chainId }: Props) => { // get nfts const nftRes = await fetch( - `${process.env.REACT_APP_PROXY_URL}/${chainId}/moralis/nft/${tokenAddress}/${tokenId}}` + `${process.env.REACT_APP_PROXY_URL}/${chainId}/moralis/nft/${tokenAddress}/${tokenId}` ) if (!nftRes.ok) { throw new Error("NFT request failed") diff --git a/frontend/src/router.tsx b/frontend/src/router.tsx index cbf7908..7fb6e65 100644 --- a/frontend/src/router.tsx +++ b/frontend/src/router.tsx @@ -10,7 +10,7 @@ export default createBrowserRouter([ element: , }, { - path: "mechs/:token/:tokenId", + path: "mech/:token/:tokenId", element: , }, {