From e34c04b9eadcb5668fa8631b7f8d3a50fe785563 Mon Sep 17 00:00:00 2001 From: Marco van Dijk Date: Fri, 22 Apr 2022 02:10:04 +0200 Subject: [PATCH] cut off domains in pie charts --- src/components/WinnerMonth.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/WinnerMonth.js b/src/components/WinnerMonth.js index e4d8c5a..32a302d 100644 --- a/src/components/WinnerMonth.js +++ b/src/components/WinnerMonth.js @@ -39,6 +39,9 @@ const WinnerMonth = (obj) => { if (thisDomain && thisDomain.domain) { for (const thisAddr of livepeer.ensInfoMapping) { if (thisAddr.domain === thisDomain.domain) { + if (thisAddr.domain.length > 18){ + return (thisAddr.domain.substring(0, 16) + ".."); + } return thisAddr.domain; } } @@ -48,16 +51,19 @@ const WinnerMonth = (obj) => { for (const thisAddr of livepeer.threeBoxInfo) { if (thisAddr.address === address) { if (thisAddr.name) { + if (thisAddr.name.length > 18){ + return (thisAddr.name.substring(0, 16) + ".."); + } return thisAddr.name; } else { - return (address.substring(0, 14) + ".."); + return (address.substring(0, 16) + ".."); } break; } } } - return (address.substring(0, 14) + ".."); + return (address.substring(0, 16) + ".."); } // Show all orchs (if latestTotalStake exists) or show only those in winningTicketsReceived