From 6ae1d33afd5f65c2ffe74b3196c9cd73dbbbb872 Mon Sep 17 00:00:00 2001 From: Ebube Agwaze Date: Tue, 9 Jan 2024 09:33:13 +0100 Subject: [PATCH] fix: more bugs fixed --- .../widget/CPlanet/DAO/Explore.jsx | 7 ++-- apps/BosGenaDrop/widget/CPlanet/DAO/Index.jsx | 4 +-- .../widget/CPlanet/DAO/Members/Card.jsx | 8 ++--- .../CPlanet/DAO/Members/CouncilCard.jsx | 2 +- .../widget/CPlanet/DAO/ProfileNFTs.jsx | 33 ++++++++++++------- apps/BosGenaDrop/widget/CPlanet/Home/Home.jsx | 6 ++-- apps/BosGenaDrop/widget/CPlanet/Home/NFTs.jsx | 2 +- .../widget/CPlanet/NFTCard/Index.jsx | 24 ++++++++++---- build/BosGenaDrop/src/CPlanet/DAO/Explore.jsx | 7 ++-- build/BosGenaDrop/src/CPlanet/DAO/Index.jsx | 4 +-- .../src/CPlanet/DAO/Members/Card.jsx | 8 ++--- .../src/CPlanet/DAO/Members/CouncilCard.jsx | 2 +- .../src/CPlanet/DAO/ProfileNFTs.jsx | 33 ++++++++++++------- build/BosGenaDrop/src/CPlanet/Home/Home.jsx | 6 ++-- build/BosGenaDrop/src/CPlanet/Home/NFTs.jsx | 2 +- .../BosGenaDrop/src/CPlanet/NFTCard/Index.jsx | 24 ++++++++++---- 16 files changed, 112 insertions(+), 60 deletions(-) diff --git a/apps/BosGenaDrop/widget/CPlanet/DAO/Explore.jsx b/apps/BosGenaDrop/widget/CPlanet/DAO/Explore.jsx index 062a919d..7d508cd4 100644 --- a/apps/BosGenaDrop/widget/CPlanet/DAO/Explore.jsx +++ b/apps/BosGenaDrop/widget/CPlanet/DAO/Explore.jsx @@ -62,7 +62,7 @@ const Search = styled.div` gap: 10px; flex-wrap: wrap; input { - border-radius: 32px; + border-radius: 8px; flex-shrink: 0; height: 48px; width: 65%; @@ -110,6 +110,9 @@ const Explore = styled.div` flex-direction: column; align-items: center; justify-contents: center; + max-width: 1400px; + margin-left: auto; + margin-right: auto; `; const NoResult = styled.div` @@ -160,7 +163,7 @@ return ( onChange={seachInputHandler} placeholder="Search for DAOs" /> - Filter/Dropdown + {/* Filter/Dropdown */} diff --git a/apps/BosGenaDrop/widget/CPlanet/DAO/Index.jsx b/apps/BosGenaDrop/widget/CPlanet/DAO/Index.jsx index d63ef0f3..0ee97b11 100644 --- a/apps/BosGenaDrop/widget/CPlanet/DAO/Index.jsx +++ b/apps/BosGenaDrop/widget/CPlanet/DAO/Index.jsx @@ -571,13 +571,13 @@ return ( )} {state.selectedTab === "members" && ( )} {state.selectedTab === "nfts" && ( )} diff --git a/apps/BosGenaDrop/widget/CPlanet/DAO/Members/Card.jsx b/apps/BosGenaDrop/widget/CPlanet/DAO/Members/Card.jsx index 7a46f97a..7e60dc55 100644 --- a/apps/BosGenaDrop/widget/CPlanet/DAO/Members/Card.jsx +++ b/apps/BosGenaDrop/widget/CPlanet/DAO/Members/Card.jsx @@ -228,7 +228,7 @@ return ( />

- {makeAccountIdShorter(profile.name, 19) ?? "OG Badge (SBT) DAO"} + {makeAccountIdShorter(profile.name ?? daoId, 19)}

@{makeAccountIdShorter(daoId) ?? "@og-sbt.sputnik-dao.near"} @@ -246,7 +246,7 @@ return (

DAO Member Since

- {props.joined ?? "DEC 18, 2018"} + {props.joined ?? "N/A"}

Joined CPlanet

@@ -271,11 +271,11 @@ return (

Member Stats

-

{props.totalVotes ?? "9,9999"}

+

{props.totalVotes ?? "0"}

Votes Casted
-

{props.proposal ?? "9,9999"}

+

{props.proposal ?? "0"}

Proposal Accepted
diff --git a/apps/BosGenaDrop/widget/CPlanet/DAO/Members/CouncilCard.jsx b/apps/BosGenaDrop/widget/CPlanet/DAO/Members/CouncilCard.jsx index 40e26e7d..c6e5a032 100644 --- a/apps/BosGenaDrop/widget/CPlanet/DAO/Members/CouncilCard.jsx +++ b/apps/BosGenaDrop/widget/CPlanet/DAO/Members/CouncilCard.jsx @@ -70,7 +70,7 @@ return ( />

- {makeAccountIdShorter(profile.name, 90) ?? "OG Badge (SBT) DAO"} + {makeAccountIdShorter(profile.name ?? daoId, 90)}

{props.userId ?? "@og-sbt.sputnik-dao.near"}
diff --git a/apps/BosGenaDrop/widget/CPlanet/DAO/ProfileNFTs.jsx b/apps/BosGenaDrop/widget/CPlanet/DAO/ProfileNFTs.jsx index 8dc80793..f1694c99 100644 --- a/apps/BosGenaDrop/widget/CPlanet/DAO/ProfileNFTs.jsx +++ b/apps/BosGenaDrop/widget/CPlanet/DAO/ProfileNFTs.jsx @@ -25,6 +25,10 @@ const Cards = styled.div` justify-content: center; `; +const logo = + "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTrJuxjGxj4QmyreE6ix4ygqm5pK9Nn_rdc8Ndw6lmJcd0SSnm2zBIc2xJ_My1V0WmK2zg&usqp=CAU"; + + const fetchStoreFrontData = (owner, contractId) => { const response2 = fetch("https://graph.mintbase.xyz/mainnet", { method: "POST", @@ -47,6 +51,7 @@ const fetchStoreFrontData = (owner, contractId) => { } metadata_id description + owner media last_transfer_receipt_id } @@ -75,20 +80,26 @@ return ( title: data.title, description: data.description, image: data.media, - - price: data.listed, - owner: "", - price: data?.listings?.length - ? (data?.listings?.price / 1000000000000000000000000).toFixed( - 2 - ) + owner: data.owner, + chainState: "near", + logo, + onButtonClick: () => + props.update({ + tab: "singleNFT", + contractId: data.nft_contract_id, + tokenId: data.token_id, + chainState: "near", + }), + price: data.listings.length + ? ( + data.listings.length / 1000000000000000000000000 + ).toFixed(2) : null, - isListed: data?.listings?.price ? "LISTED" : "NOT LISTED", - tokenId: data.metadata_id, + isListed: data.listings.length ? "LISTED" : "NOT LISTED", + tokenId: data.token_id, contractId: data.nft_contract_id, - metadataId: data.metadata_id, }} - src="jgodwill.near/widget/Mintbase.NFTCard.index" + src="bos.genadrop.near/widget/CPlanet.NFTCard.Index" />
)) diff --git a/apps/BosGenaDrop/widget/CPlanet/Home/Home.jsx b/apps/BosGenaDrop/widget/CPlanet/Home/Home.jsx index f47c1bd1..92cf6ff2 100644 --- a/apps/BosGenaDrop/widget/CPlanet/Home/Home.jsx +++ b/apps/BosGenaDrop/widget/CPlanet/Home/Home.jsx @@ -123,12 +123,12 @@ const CTA = styled.div` img { width: 250px; height: 250px; - object-fit: cover; /* Maintain image aspect ratio */ + object-fit: cover; border-radius: 50%; - animation: rotateImage 5s linear infinite; /* Adjust the duration (5s) and timing function (linear) as needed */ + animation: rotateImage 5s linear infinite; } img:hover { - animation-play-state: paused; /* Pause the rotation on hover */ + animation-play-state: paused; } @keyframes rotateImage { from { diff --git a/apps/BosGenaDrop/widget/CPlanet/Home/NFTs.jsx b/apps/BosGenaDrop/widget/CPlanet/Home/NFTs.jsx index def2c1e7..f1ba5bc0 100644 --- a/apps/BosGenaDrop/widget/CPlanet/Home/NFTs.jsx +++ b/apps/BosGenaDrop/widget/CPlanet/Home/NFTs.jsx @@ -189,7 +189,7 @@ return ( className="all" onClick={() => props.update({ tab: "explore" })} > - Show All NFTs (50) + Show All NFTs (50+)
diff --git a/apps/BosGenaDrop/widget/CPlanet/NFTCard/Index.jsx b/apps/BosGenaDrop/widget/CPlanet/NFTCard/Index.jsx index 37bdfef2..b8e6a872 100644 --- a/apps/BosGenaDrop/widget/CPlanet/NFTCard/Index.jsx +++ b/apps/BosGenaDrop/widget/CPlanet/NFTCard/Index.jsx @@ -72,7 +72,7 @@ const verifiedCheck = ( const HeaderText = styled.div` height: 150px; - p { + a { margin-bottom: 10px; overflow: hidden; color: #B0B0B0; @@ -184,6 +184,13 @@ const verifiedCheck = ( margin-left: 5px; } `; + + function makeAccountIdShorter(accountId, shortenLength) { + if (accountId.length > shortenLength) { + return accountId.slice(0, shortenLength) + "..."; + } + return accountId; + } return ( @@ -199,16 +206,21 @@ const verifiedCheck = ( -

{props.title ?? `My NFT CARD`}

+

{makeAccountIdShorter(props?.title ?? "-- No Title --", 35)}

-

{props.owner ?? "My User"}

+ + {props?.owner} + {verifiedCheck}

- {props.description?.substring( + {props?.description ? props.description?.substring( 0, - 70 - ) ?? + 50 + ) : "-- No Description --" }

diff --git a/build/BosGenaDrop/src/CPlanet/DAO/Explore.jsx b/build/BosGenaDrop/src/CPlanet/DAO/Explore.jsx index 062a919d..7d508cd4 100644 --- a/build/BosGenaDrop/src/CPlanet/DAO/Explore.jsx +++ b/build/BosGenaDrop/src/CPlanet/DAO/Explore.jsx @@ -62,7 +62,7 @@ const Search = styled.div` gap: 10px; flex-wrap: wrap; input { - border-radius: 32px; + border-radius: 8px; flex-shrink: 0; height: 48px; width: 65%; @@ -110,6 +110,9 @@ const Explore = styled.div` flex-direction: column; align-items: center; justify-contents: center; + max-width: 1400px; + margin-left: auto; + margin-right: auto; `; const NoResult = styled.div` @@ -160,7 +163,7 @@ return ( onChange={seachInputHandler} placeholder="Search for DAOs" /> - Filter/Dropdown + {/* Filter/Dropdown */} diff --git a/build/BosGenaDrop/src/CPlanet/DAO/Index.jsx b/build/BosGenaDrop/src/CPlanet/DAO/Index.jsx index d63ef0f3..0ee97b11 100644 --- a/build/BosGenaDrop/src/CPlanet/DAO/Index.jsx +++ b/build/BosGenaDrop/src/CPlanet/DAO/Index.jsx @@ -571,13 +571,13 @@ return ( )} {state.selectedTab === "members" && ( )} {state.selectedTab === "nfts" && ( )} diff --git a/build/BosGenaDrop/src/CPlanet/DAO/Members/Card.jsx b/build/BosGenaDrop/src/CPlanet/DAO/Members/Card.jsx index 7a46f97a..7e60dc55 100644 --- a/build/BosGenaDrop/src/CPlanet/DAO/Members/Card.jsx +++ b/build/BosGenaDrop/src/CPlanet/DAO/Members/Card.jsx @@ -228,7 +228,7 @@ return ( />

- {makeAccountIdShorter(profile.name, 19) ?? "OG Badge (SBT) DAO"} + {makeAccountIdShorter(profile.name ?? daoId, 19)}

@{makeAccountIdShorter(daoId) ?? "@og-sbt.sputnik-dao.near"} @@ -246,7 +246,7 @@ return (

DAO Member Since

- {props.joined ?? "DEC 18, 2018"} + {props.joined ?? "N/A"}

Joined CPlanet

@@ -271,11 +271,11 @@ return (

Member Stats

-

{props.totalVotes ?? "9,9999"}

+

{props.totalVotes ?? "0"}

Votes Casted
-

{props.proposal ?? "9,9999"}

+

{props.proposal ?? "0"}

Proposal Accepted
diff --git a/build/BosGenaDrop/src/CPlanet/DAO/Members/CouncilCard.jsx b/build/BosGenaDrop/src/CPlanet/DAO/Members/CouncilCard.jsx index 40e26e7d..c6e5a032 100644 --- a/build/BosGenaDrop/src/CPlanet/DAO/Members/CouncilCard.jsx +++ b/build/BosGenaDrop/src/CPlanet/DAO/Members/CouncilCard.jsx @@ -70,7 +70,7 @@ return ( />

- {makeAccountIdShorter(profile.name, 90) ?? "OG Badge (SBT) DAO"} + {makeAccountIdShorter(profile.name ?? daoId, 90)}

{props.userId ?? "@og-sbt.sputnik-dao.near"}
diff --git a/build/BosGenaDrop/src/CPlanet/DAO/ProfileNFTs.jsx b/build/BosGenaDrop/src/CPlanet/DAO/ProfileNFTs.jsx index 8dc80793..f1694c99 100644 --- a/build/BosGenaDrop/src/CPlanet/DAO/ProfileNFTs.jsx +++ b/build/BosGenaDrop/src/CPlanet/DAO/ProfileNFTs.jsx @@ -25,6 +25,10 @@ const Cards = styled.div` justify-content: center; `; +const logo = + "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTrJuxjGxj4QmyreE6ix4ygqm5pK9Nn_rdc8Ndw6lmJcd0SSnm2zBIc2xJ_My1V0WmK2zg&usqp=CAU"; + + const fetchStoreFrontData = (owner, contractId) => { const response2 = fetch("https://graph.mintbase.xyz/mainnet", { method: "POST", @@ -47,6 +51,7 @@ const fetchStoreFrontData = (owner, contractId) => { } metadata_id description + owner media last_transfer_receipt_id } @@ -75,20 +80,26 @@ return ( title: data.title, description: data.description, image: data.media, - - price: data.listed, - owner: "", - price: data?.listings?.length - ? (data?.listings?.price / 1000000000000000000000000).toFixed( - 2 - ) + owner: data.owner, + chainState: "near", + logo, + onButtonClick: () => + props.update({ + tab: "singleNFT", + contractId: data.nft_contract_id, + tokenId: data.token_id, + chainState: "near", + }), + price: data.listings.length + ? ( + data.listings.length / 1000000000000000000000000 + ).toFixed(2) : null, - isListed: data?.listings?.price ? "LISTED" : "NOT LISTED", - tokenId: data.metadata_id, + isListed: data.listings.length ? "LISTED" : "NOT LISTED", + tokenId: data.token_id, contractId: data.nft_contract_id, - metadataId: data.metadata_id, }} - src="jgodwill.near/widget/Mintbase.NFTCard.index" + src="bos.genadrop.near/widget/CPlanet.NFTCard.Index" />
)) diff --git a/build/BosGenaDrop/src/CPlanet/Home/Home.jsx b/build/BosGenaDrop/src/CPlanet/Home/Home.jsx index f47c1bd1..92cf6ff2 100644 --- a/build/BosGenaDrop/src/CPlanet/Home/Home.jsx +++ b/build/BosGenaDrop/src/CPlanet/Home/Home.jsx @@ -123,12 +123,12 @@ const CTA = styled.div` img { width: 250px; height: 250px; - object-fit: cover; /* Maintain image aspect ratio */ + object-fit: cover; border-radius: 50%; - animation: rotateImage 5s linear infinite; /* Adjust the duration (5s) and timing function (linear) as needed */ + animation: rotateImage 5s linear infinite; } img:hover { - animation-play-state: paused; /* Pause the rotation on hover */ + animation-play-state: paused; } @keyframes rotateImage { from { diff --git a/build/BosGenaDrop/src/CPlanet/Home/NFTs.jsx b/build/BosGenaDrop/src/CPlanet/Home/NFTs.jsx index def2c1e7..f1ba5bc0 100644 --- a/build/BosGenaDrop/src/CPlanet/Home/NFTs.jsx +++ b/build/BosGenaDrop/src/CPlanet/Home/NFTs.jsx @@ -189,7 +189,7 @@ return ( className="all" onClick={() => props.update({ tab: "explore" })} > - Show All NFTs (50) + Show All NFTs (50+)
diff --git a/build/BosGenaDrop/src/CPlanet/NFTCard/Index.jsx b/build/BosGenaDrop/src/CPlanet/NFTCard/Index.jsx index 37bdfef2..b8e6a872 100644 --- a/build/BosGenaDrop/src/CPlanet/NFTCard/Index.jsx +++ b/build/BosGenaDrop/src/CPlanet/NFTCard/Index.jsx @@ -72,7 +72,7 @@ const verifiedCheck = ( const HeaderText = styled.div` height: 150px; - p { + a { margin-bottom: 10px; overflow: hidden; color: #B0B0B0; @@ -184,6 +184,13 @@ const verifiedCheck = ( margin-left: 5px; } `; + + function makeAccountIdShorter(accountId, shortenLength) { + if (accountId.length > shortenLength) { + return accountId.slice(0, shortenLength) + "..."; + } + return accountId; + } return ( @@ -199,16 +206,21 @@ const verifiedCheck = ( -

{props.title ?? `My NFT CARD`}

+

{makeAccountIdShorter(props?.title ?? "-- No Title --", 35)}

-

{props.owner ?? "My User"}

+ + {props?.owner} + {verifiedCheck}

- {props.description?.substring( + {props?.description ? props.description?.substring( 0, - 70 - ) ?? + 50 + ) : "-- No Description --" }