Skip to content

Commit

Permalink
Merge pull request #1152 from edenia/dev
Browse files Browse the repository at this point in the history
Production Release
  • Loading branch information
xavier506 authored Feb 9, 2023
2 parents c66d58b + 035e644 commit 2841a46
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 37 deletions.
22 changes: 17 additions & 5 deletions webapp/src/components/NonCompliantCard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,7 @@ const NonCompliantCard = ({ producer, stats }) => {
>
{t('bpJson')}:
</Typography>
<VisitSite
title={t('openLink')}
url={producer.bp_json_url}
/>
<VisitSite title={t('openLink')} url={producer.bp_json_url} />
</div>
)}
<RowInfo
Expand All @@ -106,7 +103,7 @@ const NonCompliantCard = ({ producer, stats }) => {
<Typography variant="overline">{t('dailyRewards')}</Typography>
<RowInfo
title={`${t('rewards')} (USD)`}
value={`$${formatWithThousandSeparator(
value={`$ ${formatWithThousandSeparator(
producer.total_rewards * stats.tokenPrice,
0,
)}`}
Expand All @@ -115,6 +112,21 @@ const NonCompliantCard = ({ producer, stats }) => {
title={`${t('rewards')} (${eosConfig.tokenSymbol})`}
value={`${formatWithThousandSeparator(producer.total_rewards, 0)}`}
/>
<Typography variant="overline">{t('yearlyRewards')}</Typography>
<RowInfo
title={`${t('rewards')} (USD)`}
value={`$ ${formatWithThousandSeparator(
producer.total_rewards * 365 * stats.tokenPrice,
0,
)}`}
/>
<RowInfo
title={`${t('rewards')} (${eosConfig.tokenSymbol})`}
value={`${formatWithThousandSeparator(
producer.total_rewards * 365,
0,
)}`}
/>
</div>
</>
)
Expand Down
1 change: 1 addition & 0 deletions webapp/src/hooks/customHooks/useNonCompliantState.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const useNonCompliantState = () => {
setStats({
percentageRewards,
dailyRewards: nonCompliantRewards,
yearlyRewards: nonCompliantRewards * 365,
tokenPrice: setting?.token_price,
quantity: nonCompliantBPs.length,
})
Expand Down
6 changes: 4 additions & 2 deletions webapp/src/language/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions webapp/src/language/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
43 changes: 29 additions & 14 deletions webapp/src/routes/NonCompliantBPs/RewardsStats.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,42 @@ const RewardsStats = ({ stats }) => {
</div>
<div className={`${classes.cardHeader} ${classes.cardShadow}`}>
<div className={classes.rewardsCards}>
<Typography variant="h6" component="h4">{`${t(
'dailyRewards',
)} (USD)`}</Typography>
<Typography variant="h3" component="p" className={classes.statsText}>
{`${formatWithThousandSeparator(
stats.dailyRewards * stats.tokenPrice,
0,
)} USD`}
<Typography variant="h6" component="h4">
{t('dailyRewards')}
</Typography>
<div className={classes.statsText}>
<Typography variant="h3" component="p" className={classes.price}>
{`${formatWithThousandSeparator(stats.dailyRewards, 0)} ${
eosConfig.tokenSymbol
}`}
</Typography>
<Typography variant="h3" component="p" className={classes.price}>
{`$ ${formatWithThousandSeparator(
stats.dailyRewards * stats.tokenPrice,
0,
)} USD`}
</Typography>
</div>
</div>
</div>
<div className={`${classes.cardHeader} ${classes.cardShadow}`}>
<div className={classes.rewardsCards}>
<Typography variant="h6" component="h4">
{`${t('dailyRewards')} (${eosConfig.tokenSymbol})`}
</Typography>
<Typography variant="h3" component="p" className={classes.statsText}>
{`${formatWithThousandSeparator(stats.dailyRewards, 0)} ${
eosConfig.tokenSymbol
}`}
{t('yearlyRewards')}
</Typography>
<div className={classes.statsText}>
<Typography variant="h3" component="p" className={classes.price}>
{`${formatWithThousandSeparator(stats.yearlyRewards, 0)} ${
eosConfig.tokenSymbol
}`}
</Typography>
<Typography variant="h3" component="p" className={classes.price}>
{`$ ${formatWithThousandSeparator(
stats.yearlyRewards * stats.tokenPrice,
0,
)} USD`}
</Typography>
</div>
</div>
</div>
<div className={`${classes.cardHeader} ${classes.cardShadow}`}>
Expand Down
5 changes: 4 additions & 1 deletion webapp/src/routes/NonCompliantBPs/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
28 changes: 13 additions & 15 deletions webapp/src/routes/RewardsDistribution/RewardsDistributionStats.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down Expand Up @@ -130,27 +126,29 @@ const RewardsDistributionStats = ({
)}
</div>
<Typography variant="h3" component="p">
{!summary?.producersWithoutProperBpJson.quantity > 0 && (
{!summary?.producersWithoutProperBpJson.quantity > 0 ?? (
<Skeleton variant="text" width="100%" animation="wave" />
)}
{summary?.producersWithoutProperBpJson.quantity > 0 &&
{summary?.producersWithoutProperBpJson.quantity >= 0 &&
summary?.producersWithoutProperBpJson.quantity && (
<span>{summary?.producersWithoutProperBpJson.quantity}</span>
)}
</Typography>
<Typography
variant="subtitle2"
component="p"
className={`${classes.textMargin} ${classes.marginPaidText}`}
>
{t('paidProducersText')}
</Typography>
{summary?.producersWithoutProperBpJson.rewards > 0 && (
<Typography
variant="subtitle2"
component="p"
className={`${classes.textMargin} ${classes.marginPaidText}`}
>
{t('paidProducersText')}
</Typography>
)}
<Typography
variant="subtitle1"
component="p"
className={classes.textMargin}
>
{!summary?.producersWithoutProperBpJson.rewards > 0 && (
{!summary?.producersWithoutProperBpJson.rewards > 0 ?? (
<Skeleton variant="text" width="100%" animation="wave" />
)}
{summary?.producersWithoutProperBpJson.rewards > 0 && (
Expand Down

0 comments on commit 2841a46

Please sign in to comment.