From 029da2be046d61519c9d40e20c0b4b014e8cf0ab Mon Sep 17 00:00:00 2001 From: Xavier Fernandez Date: Mon, 6 Feb 2023 20:47:02 -0600 Subject: [PATCH 1/4] fix(webapp): update undiscoverable bps sidebar text --- webapp/src/language/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/src/language/en.json b/webapp/src/language/en.json index 9fbc8d86..23256c1e 100644 --- a/webapp/src/language/en.json +++ b/webapp/src/language/en.json @@ -56,7 +56,7 @@ "/block-producers>sidebar": "Block Producers", "/block-producers>title": "Block Producers - EOSIO + Antelope Network Dashboard", "/block-producers>heading": "Block Producers", - "/undiscoverable-bps>sidebar": "Undiscoverable Producers", + "/undiscoverable-bps>sidebar": "Undiscoverable BPs", "/undiscoverable-bps>title": "Undiscoverable Block Producers or Sock Puppet BPs - EOSIO + Antelope Network Dashboard", "/undiscoverable-bps>heading": "Undiscoverable Paid Block Producers", "/rewards-distribution>sidebar": "Rewards Distribution", From c25eb1e459114791ba797deca491461b272397b6 Mon Sep 17 00:00:00 2001 From: Xavier Fernandez Date: Mon, 6 Feb 2023 21:09:39 -0600 Subject: [PATCH 2/4] fix(webapp): update accounts and contracts sidebar text --- webapp/src/language/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/src/language/en.json b/webapp/src/language/en.json index 23256c1e..4805e30c 100644 --- a/webapp/src/language/en.json +++ b/webapp/src/language/en.json @@ -68,7 +68,7 @@ "/nodes-distribution>sidebar": "Geo Distribution", "/nodes-distribution>title": "Geographic Distribution of Nodes - EOSIO + Antelope Network Dashboard", "/nodes-distribution>heading": "Geographic Distribution of Nodes", - "/accounts>sidebar": "Accounts and Contracts", + "/accounts>sidebar": "Accounts & Contracts", "/accounts>title": "Accounts and Contracts - EOSIO + Antelope Network Dashboard", "/accounts>heading": "Accounts and Contracts", "/bpjson>sidebar": "BP.json Generator", From 50337c6b6574200168568835232f00eaee38e11e Mon Sep 17 00:00:00 2001 From: Torresmorah Date: Wed, 8 Feb 2023 14:26:47 -0600 Subject: [PATCH 3/4] feat(webapp): add yearly rewards and fix infinite skeleton --- .../src/components/NonCompliantCard/index.js | 20 +++++++-- .../hooks/customHooks/useNonCompliantState.js | 1 + webapp/src/language/en.json | 2 + webapp/src/language/es.json | 2 + .../routes/NonCompliantBPs/RewardsStats.js | 43 +++++++++++++------ webapp/src/routes/NonCompliantBPs/styles.js | 5 ++- .../RewardsDistributionStats.js | 28 ++++++------ 7 files changed, 67 insertions(+), 34 deletions(-) diff --git a/webapp/src/components/NonCompliantCard/index.js b/webapp/src/components/NonCompliantCard/index.js index 7f7f4708..c24fddba 100644 --- a/webapp/src/components/NonCompliantCard/index.js +++ b/webapp/src/components/NonCompliantCard/index.js @@ -85,10 +85,7 @@ const NonCompliantCard = ({ producer, stats }) => { > {t('bpJson')}: - + )} { title={`${t('rewards')} (${eosConfig.tokenSymbol})`} value={`${formatWithThousandSeparator(producer.total_rewards, 0)}`} /> + {t('yearlyRewards')} + + ) diff --git a/webapp/src/hooks/customHooks/useNonCompliantState.js b/webapp/src/hooks/customHooks/useNonCompliantState.js index e9a5c1bf..f9ff7667 100644 --- a/webapp/src/hooks/customHooks/useNonCompliantState.js +++ b/webapp/src/hooks/customHooks/useNonCompliantState.js @@ -53,6 +53,7 @@ const useNonCompliantState = () => { setStats({ percentageRewards, dailyRewards: nonCompliantRewards, + yearlyRewards: nonCompliantRewards * 365, tokenPrice: setting?.token_price, quantity: nonCompliantBPs.length, }) diff --git a/webapp/src/language/en.json b/webapp/src/language/en.json index 4805e30c..e8d10b83 100644 --- a/webapp/src/language/en.json +++ b/webapp/src/language/en.json @@ -148,6 +148,7 @@ "blockProducersRoute": {}, "rewardsDistributionRoute": { "dailyRewards": "Total Daily Rewards", + "yearlyRewards": "Total Yearly Rewards", "topCountryDailyRwards": "Top Country By Daily Rewards", "notAvailable": "Not available", "paidProducers": "Paid BPs Not Located", @@ -262,6 +263,7 @@ "lastClaimTime": "Last Claimed Time", "noInfo": "No info provided", "dailyRewards": "Daily Rewards", + "yearlyRewards": "Yearly Rewards", "invalidUrl": "Invalid URL", "viewList": "View undiscoverable BPs list", "bpJson": "BP.json", diff --git a/webapp/src/language/es.json b/webapp/src/language/es.json index 4f167f9b..ea67d232 100644 --- a/webapp/src/language/es.json +++ b/webapp/src/language/es.json @@ -154,6 +154,7 @@ "blockProducersRoute": {}, "rewardsDistributionRoute": { "dailyRewards": "Recompensas Diarias Totales", + "yearlyRewards": "Recompensas Anuales Totales", "topCountryDailyRwards": "País Superior Por Recompensas Diarias", "notAvailable": "No Disponible", "paidProducers": "Productores Pagados No Ubicados", @@ -269,6 +270,7 @@ "lastClaimTime": "Último reclamo", "noInfo": "No provee información", "dailyRewards": "Recompensas diarias", + "yearlyRewards": "Recompensas anuales", "invalidUrl": "URL inválida", "viewList": "Ver lista de BPs indetectables", "bpJson": "BP.json", diff --git a/webapp/src/routes/NonCompliantBPs/RewardsStats.js b/webapp/src/routes/NonCompliantBPs/RewardsStats.js index 16b5cb9b..b28875ad 100644 --- a/webapp/src/routes/NonCompliantBPs/RewardsStats.js +++ b/webapp/src/routes/NonCompliantBPs/RewardsStats.js @@ -29,27 +29,42 @@ const RewardsStats = ({ stats }) => {
- {`${t( - 'dailyRewards', - )} (USD)`} - - {`${formatWithThousandSeparator( - stats.dailyRewards * stats.tokenPrice, - 0, - )} USD`} + + {t('dailyRewards')} +
+ + {`${formatWithThousandSeparator(stats.dailyRewards, 0)} ${ + eosConfig.tokenSymbol + }`} + + + {`$ ${formatWithThousandSeparator( + stats.dailyRewards * stats.tokenPrice, + 0, + )} USD`} + +
- {`${t('dailyRewards')} (${eosConfig.tokenSymbol})`} - - - {`${formatWithThousandSeparator(stats.dailyRewards, 0)} ${ - eosConfig.tokenSymbol - }`} + {t('dailyRewards')} +
+ + {`${formatWithThousandSeparator(stats.yearlyRewards, 0)} ${ + eosConfig.tokenSymbol + }`} + + + {`$ ${formatWithThousandSeparator( + stats.yearlyRewards * stats.tokenPrice, + 0, + )} USD`} + +
diff --git a/webapp/src/routes/NonCompliantBPs/styles.js b/webapp/src/routes/NonCompliantBPs/styles.js index 149212f3..7b7ba58e 100644 --- a/webapp/src/routes/NonCompliantBPs/styles.js +++ b/webapp/src/routes/NonCompliantBPs/styles.js @@ -4,7 +4,10 @@ export default (theme) => ({ }, statsText: { textAlign: 'center', - marginTop: `${theme.spacing(6)} !important`, + marginTop: `${theme.spacing(4)} !important`, + }, + price: { + paddingBottom: theme.spacing(2), }, statsContainer: { display: 'flex', diff --git a/webapp/src/routes/RewardsDistribution/RewardsDistributionStats.js b/webapp/src/routes/RewardsDistribution/RewardsDistributionStats.js index 7be01946..1a2227bd 100644 --- a/webapp/src/routes/RewardsDistribution/RewardsDistributionStats.js +++ b/webapp/src/routes/RewardsDistribution/RewardsDistributionStats.js @@ -23,11 +23,7 @@ const useStyles = makeStyles((theme) => styles(theme, lowestRewardsColor, highestRewardsColor), ) -const RewardsDistributionStats = ({ - summary, - setting, - handlePopoverOpen, -}) => { +const RewardsDistributionStats = ({ summary, setting, handlePopoverOpen }) => { const classes = useStyles() const { t } = useTranslation('rewardsDistributionRoute') @@ -130,27 +126,29 @@ const RewardsDistributionStats = ({ )}
- {!summary?.producersWithoutProperBpJson.quantity > 0 && ( + {!summary?.producersWithoutProperBpJson.quantity > 0 ?? ( )} - {summary?.producersWithoutProperBpJson.quantity > 0 && + {summary?.producersWithoutProperBpJson.quantity >= 0 && summary?.producersWithoutProperBpJson.quantity && ( {summary?.producersWithoutProperBpJson.quantity} )} - - {t('paidProducersText')} - + {summary?.producersWithoutProperBpJson.rewards > 0 && ( + + {t('paidProducersText')} + + )} - {!summary?.producersWithoutProperBpJson.rewards > 0 && ( + {!summary?.producersWithoutProperBpJson.rewards > 0 ?? ( )} {summary?.producersWithoutProperBpJson.rewards > 0 && ( From 2bc60e87200aaf64e225c751f564ca8e28bd294d Mon Sep 17 00:00:00 2001 From: Torresmorah Date: Thu, 9 Feb 2023 14:29:20 -0600 Subject: [PATCH 4/4] fix(webapp): add space after dollar symbol and fix wrong title --- webapp/src/components/NonCompliantCard/index.js | 4 ++-- webapp/src/routes/NonCompliantBPs/RewardsStats.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/webapp/src/components/NonCompliantCard/index.js b/webapp/src/components/NonCompliantCard/index.js index c24fddba..feb7d64b 100644 --- a/webapp/src/components/NonCompliantCard/index.js +++ b/webapp/src/components/NonCompliantCard/index.js @@ -103,7 +103,7 @@ const NonCompliantCard = ({ producer, stats }) => { {t('dailyRewards')} { {t('yearlyRewards')} {
- {t('dailyRewards')} + {t('yearlyRewards')}