Skip to content

Commit

Permalink
fixed da consumers display
Browse files Browse the repository at this point in the history
  • Loading branch information
mokelgit committed Jan 14, 2025
1 parent 19e66e9 commit 215cf3c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 37 deletions.
49 changes: 13 additions & 36 deletions components/layout/DA-Overview/DATable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -339,16 +339,14 @@ export default function DATable({breakdown_data, selectedTimespan, isMonthly}: {
const createDAConsumers = useCallback((da_row) => {
if (!master) return;

const tempBrokeChains = ["orderly", "manta", "derive", "ancient8", "karak"]
let more = 0;

let addedLogos = 0;

const retHTML = da_row.chains.values.map((chain, index) => {

if (chain[1] && chain[1] !== "gitcoin_pgn" && !tempBrokeChains.includes(chain[1])) {
console.log(chain[1])
console.log(AllChainsByKeys[chain[1]] ? "" : master.custom_logos[chain[1]].body)

const chainLogoExists = (AllChainsByKeys[chain[1]] || master.custom_logos[chain[1]]) ? true : false;

if (chainLogoExists && addedLogos < 5) {
addedLogos = addedLogos + 1;
return (
<Icon
key={index}
Expand All @@ -362,36 +360,15 @@ export default function DATable({breakdown_data, selectedTimespan, isMonthly}: {
return null; // Return null for items that don't meet the condition
});


// const iconDisplay = Array.isArray(da_row.total[1])
// ? da_row.total[1]
// .filter((chain) => chain !== "eclipse")
// .map((chain, index) => (

// ))
// : da_row.total[1];
// <Icon
// icon={
// selectedCategory !== "name"
// ? "formkit:arrowdown"
// : sortOrder
// ? "formkit:arrowdown"
// : "formkit:arrowup"
// }
// className={` w-[10px] h-[10px] ${selectedCategory === "name"
// ? "text-forest-50 opacity-100"
// : " opacity-50 group-hover:opacity-100 group-hover:text-forest-50"
// } `}
// />
return(
<div className="flex items-center gap-x-[2px]">
<div className="numbers-xs mr-[3px]">{da_row.count}</div>
{retHTML}
<div className="ml-[3px] w-[60px] px-[5px] py-[3px] rounded-full bg-[#344240] text-xxs">
{`+ ${more} more`}
</div>
return(
<div className="flex items-center gap-x-[2px]">
<div className="numbers-xs mr-[3px]">{da_row.count}</div>
{retHTML}
<div className="ml-[3px] w-[60px] px-[5px] py-[3px] rounded-full bg-[#344240] text-xxs">
{`+ ${more} more`}
</div>
)
</div>
)

// return (

Expand Down
2 changes: 1 addition & 1 deletion components/layout/DA-Overview/DATableCharts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ export default function DATableCharts({selectedTimespan, data, isMonthly, da_nam
function (this: any) {


console.log(this)

return `<div class="mt-3 mr-3 mb-3 w-40 text-xs font-raleway justify-between gap-x-[5px] flex items-center">
<div class="flex gap-x-[5px] items-center ">
<div class="w-4 h-1.5 rounded-r-full" style="background-color: ${this.color}"></div>
Expand Down

0 comments on commit 215cf3c

Please sign in to comment.