diff --git a/hapi/src/utils/producer.util.js b/hapi/src/utils/producer.util.js index edaff8c66..b0a10b238 100644 --- a/hapi/src/utils/producer.util.js +++ b/hapi/src/utils/producer.util.js @@ -1,6 +1,5 @@ const axiosUtil = require('./axios.util') const eosUtil = require('./eos.util') -const hasuraUtil = require('./hasura.util') const net = require('node:net') const os = require('node:os') @@ -108,6 +107,15 @@ const getEndpoints = (nodes) => { return endpoints } +const getCurrencyStats = async () => { + const systemData = await eosUtil.getCurrencyStats({ + symbol: eosConfig.rewardsToken, + code: 'eosio.token' + }) + + return systemData[eosConfig.rewardsToken] +} + const getExpectedRewards = async (producers, totalVotes) => { let rewards = [] @@ -162,39 +170,49 @@ const getLibreRewards = async (producers) => { } const getTelosRewards = async (producers) => { - const telosPrice = (await getEOSPrice()) || 0 - const estimatedRewards = 8.34 * telosPrice ** -0.516 // approximate rewards per half hour - const producerRewards = Math.min(estimatedRewards * 48, 28000) + const currencyStats = await getCurrencyStats() + const { rows: payrateRows } = await eosUtil.getTableRows({ + code: 'eosio', + scope: 'eosio', + table: 'payrate', + reverse: false, + limit: 1, + json: true, + lower_bound: null + }) + + const tokenSupply = parseFloat(currencyStats.supply) + const bPayRate = payrateRows?.at(0)?.bpay_rate / 100000 + const toProducers = (bPayRate * tokenSupply) / 365 // (bPayRate * tokenSupply * secondsPerDay) / secondsPerYear + + const MAX_PAID_PRODUCERS = 42 + const topProducers = producers.slice(0, MAX_PAID_PRODUCERS) + const activeCount = topProducers.length + const shareCount = + activeCount <= 21 + ? activeCount * 2 + : MAX_PAID_PRODUCERS + (activeCount - 21) - const topProducers = producers.slice(0, 42) + const producerRewards = toProducers / shareCount return topProducers.map((producer, i) => { - const totalRewards = i < 21 ? producerRewards : producerRewards / 2 + const totalRewards = i < 21 ? producerRewards * 2 : producerRewards return { producer: producer.owner, - vote_rewards: totalRewards * 0.75, - block_rewards: totalRewards * 0.25, + vote_rewards: 0, + block_rewards: totalRewards, total_rewards: totalRewards } }) } const getEOSIORewards = async (producers, totalVotes) => { - const systemData = await eosUtil.getCurrencyStats({ - symbol: eosConfig.rewardsToken, - code: 'eosio.token' - }) + const currencyStats = await getCurrencyStats() let inflation = 0 - if ( - systemData[eosConfig.rewardsToken] && - systemData[eosConfig.rewardsToken].supply - ) { - inflation = - parseInt(systemData[eosConfig.rewardsToken].supply.split(' ')[0]) / - 100 / - 365 + if (currencyStats && currencyStats.supply) { + inflation = parseInt(currencyStats.supply.split(' ')[0]) / 100 / 365 } let blockReward = 0.25 // reward for each block produced @@ -263,7 +281,6 @@ const getEOSIORewards = async (producers, totalVotes) => { const getVotes = (votes) => { switch (eosConfig.networkName) { case eosConfig.knownNetworks.telos: - return parseFloat(votes) case eosConfig.knownNetworks.libre: return parseFloat(votes) / 10000 case eosConfig.knownNetworks.wax: @@ -281,19 +298,6 @@ const getEOSIOVotes = (votes, weekHalfLife) => { return parseFloat(votes) / 2 ** weight } -const getEOSPrice = async () => { - const query = ` - query { - setting: setting_by_pk(id: 1) { - token_price - } - } - ` - const data = await hasuraUtil.request(query) - - return data?.setting?.token_price -} - const jsonParse = (string) => { try { const json = JSON.parse(string) diff --git a/webapp/public/sitemap.jungle.xml b/webapp/public/sitemap.jungle.xml index fc4264597..18682c272 100644 --- a/webapp/public/sitemap.jungle.xml +++ b/webapp/public/sitemap.jungle.xml @@ -29,7 +29,7 @@ https://jungle.antelope.tools/undiscoverable-bps - 2023-09-30 + 2023-11-02 https://jungle.antelope.tools/cpu-benchmark @@ -49,11 +49,11 @@ https://jungle.antelope.tools/about - 2023-09-30 + 2023-11-02 https://jungle.antelope.tools/help - 2023-09-30 + 2023-11-02 https://jungle.antelope.tools/block-producers/lioninjungle diff --git a/webapp/public/sitemap.libre-testnet.xml b/webapp/public/sitemap.libre-testnet.xml index c4d2fc0aa..6b779f08f 100644 --- a/webapp/public/sitemap.libre-testnet.xml +++ b/webapp/public/sitemap.libre-testnet.xml @@ -29,7 +29,7 @@ https://libre-testnet.antelope.tools/undiscoverable-bps - 2023-09-30 + 2023-11-02 https://libre-testnet.antelope.tools/block-distribution @@ -65,11 +65,11 @@ https://libre-testnet.antelope.tools/about - 2023-09-30 + 2023-11-02 https://libre-testnet.antelope.tools/help - 2023-09-30 + 2023-11-02 https://libre-testnet.antelope.tools/block-producers/rioblocks diff --git a/webapp/public/sitemap.libre.xml b/webapp/public/sitemap.libre.xml index 7b088e895..c51aa60fe 100644 --- a/webapp/public/sitemap.libre.xml +++ b/webapp/public/sitemap.libre.xml @@ -41,7 +41,7 @@ https://libre.antelope.tools/undiscoverable-bps - 2023-09-30 + 2023-11-02 https://libre.antelope.tools/ricardian-contract @@ -57,11 +57,11 @@ https://libre.antelope.tools/about - 2023-09-30 + 2023-11-02 https://libre.antelope.tools/help - 2023-09-30 + 2023-11-02 https://libre.antelope.tools/block-producers/libretech diff --git a/webapp/public/sitemap.mainnet.xml b/webapp/public/sitemap.mainnet.xml index e0201ea68..ded98a18f 100644 --- a/webapp/public/sitemap.mainnet.xml +++ b/webapp/public/sitemap.mainnet.xml @@ -29,7 +29,7 @@ https://eos.antelope.tools/undiscoverable-bps - 2023-09-30 + 2023-11-02 https://eos.antelope.tools/ricardian-contract @@ -45,11 +45,11 @@ https://eos.antelope.tools/about - 2023-09-30 + 2023-11-02 https://eos.antelope.tools/help - 2023-09-30 + 2023-11-02 https://eos.antelope.tools/block-producers/aus1genereos diff --git a/webapp/public/sitemap.telos-testnet.xml b/webapp/public/sitemap.telos-testnet.xml index 0cca4c304..c413b3a92 100644 --- a/webapp/public/sitemap.telos-testnet.xml +++ b/webapp/public/sitemap.telos-testnet.xml @@ -30,7 +30,7 @@ https://telos-testnet.antelope.tools/undiscoverable-bps - 2023-09-30 + 2023-11-02 https://telos-testnet.antelope.tools/ricardian-contract @@ -54,11 +54,11 @@ https://telos-testnet.antelope.tools/about - 2023-09-30 + 2023-11-02 https://telos-testnet.antelope.tools/help - 2023-09-30 + 2023-11-02 https://telos-testnet.antelope.tools/block-producers/southafrica1 diff --git a/webapp/public/sitemap.telos.xml b/webapp/public/sitemap.telos.xml index f73748c4a..1025a02de 100644 --- a/webapp/public/sitemap.telos.xml +++ b/webapp/public/sitemap.telos.xml @@ -30,7 +30,7 @@ https://telos.antelope.tools/undiscoverable-bps - 2023-09-30 + 2023-11-02 https://telos.antelope.tools/ricardian-contract @@ -54,11 +54,11 @@ https://telos.antelope.tools/about - 2023-09-30 + 2023-11-02 https://telos.antelope.tools/help - 2023-09-30 + 2023-11-02 https://telos.antelope.tools/block-producers/caleosblocks diff --git a/webapp/public/sitemap.wax-testnet.xml b/webapp/public/sitemap.wax-testnet.xml index a4e447786..d9e77f61e 100644 --- a/webapp/public/sitemap.wax-testnet.xml +++ b/webapp/public/sitemap.wax-testnet.xml @@ -30,7 +30,7 @@ https://wax-testnet.antelope.tools/undiscoverable-bps - 2023-01-19 + 2023-11-02 https://wax-testnet.antelope.tools/ricardian-contract @@ -46,11 +46,11 @@ https://wax-testnet.antelope.tools/about - 2023-09-30 + 2023-11-02 https://wax-testnet.antelope.tools/help - 2023-09-30 + 2023-11-02 https://wax-testnet.antelope.tools/block-producers/blokcrafters diff --git a/webapp/public/sitemap.wax.xml b/webapp/public/sitemap.wax.xml index 0d7165b09..ddde62c3f 100644 --- a/webapp/public/sitemap.wax.xml +++ b/webapp/public/sitemap.wax.xml @@ -30,7 +30,7 @@ https://wax.antelope.tools/undiscoverable-bps - 2023-09-30 + 2023-11-02 https://wax.antelope.tools/ricardian-contract @@ -46,11 +46,11 @@ https://wax.antelope.tools/about - 2023-09-30 + 2023-11-02 https://wax.antelope.tools/help - 2023-09-30 + 2023-11-02 https://wax.antelope.tools/block-producers/nation.wax diff --git a/webapp/public/sitemap.xpr-testnet.xml b/webapp/public/sitemap.xpr-testnet.xml index 9ccf4cef2..7d800d067 100644 --- a/webapp/public/sitemap.xpr-testnet.xml +++ b/webapp/public/sitemap.xpr-testnet.xml @@ -26,7 +26,7 @@ https://xpr-testnet.antelope.tools/undiscoverable-bps - 2023-09-30 + 2023-11-02 https://xpr-testnet.antelope.tools/nodes-distribution @@ -50,11 +50,11 @@ https://xpr-testnet.antelope.tools/about - 2023-09-30 + 2023-11-02 https://xpr-testnet.antelope.tools/help - 2023-09-30 + 2023-11-02 https://xpr-testnet.antelope.tools/block-producers/saltant diff --git a/webapp/public/sitemap.xpr.xml b/webapp/public/sitemap.xpr.xml index 4dc24d813..b912edb62 100644 --- a/webapp/public/sitemap.xpr.xml +++ b/webapp/public/sitemap.xpr.xml @@ -26,7 +26,7 @@ https://xpr.antelope.tools/undiscoverable-bps - 2023-09-30 + 2023-11-02 https://xpr.antelope.tools/nodes-distribution @@ -50,11 +50,11 @@ https://xpr.antelope.tools/about - 2023-09-30 + 2023-11-02 https://xpr.antelope.tools/help - 2023-09-30 + 2023-11-02 https://xpr.antelope.tools/block-producers/protonnz diff --git a/webapp/src/components/EmptyState/index.js b/webapp/src/components/EmptyState/index.js index e933505e6..0f22a4304 100644 --- a/webapp/src/components/EmptyState/index.js +++ b/webapp/src/components/EmptyState/index.js @@ -1,14 +1,14 @@ import React from 'react' -import { Link as RouterLink } from 'react-router-dom' +import { Link } from 'react-router-dom' import { makeStyles } from '@mui/styles' import { useTranslation } from 'react-i18next' -import Link from '@mui/material/Link' +import Button from '@mui/material/Button' import styles from './styles' const useStyles = makeStyles(styles) -const EmptyState = () => { +const EmptyState = ({ isNonCompliant }) => { const classes = useStyles() const { t } = useTranslation('producerCardComponent') @@ -21,15 +21,17 @@ const EmptyState = () => { alt="" /> {t('emptyState')} - - {t('viewList')} - + {isNonCompliant && ( + + )} ) } diff --git a/webapp/src/components/EmptyState/styles.js b/webapp/src/components/EmptyState/styles.js index 7c4a1d313..0cd345412 100644 --- a/webapp/src/components/EmptyState/styles.js +++ b/webapp/src/components/EmptyState/styles.js @@ -23,10 +23,10 @@ export default (theme) => ({ alignItems: 'center', justifyContent: 'center', '& svg': { - color: theme.palette.error.light + color: theme.palette.error.light, }, '& span': { - marginTop: theme.spacing(1), + margin: theme.spacing(1, 4, 0), }, }, imgError: { diff --git a/webapp/src/components/NodesList/styles.js b/webapp/src/components/NodesList/styles.js index 52d8686a4..cdfc798f5 100644 --- a/webapp/src/components/NodesList/styles.js +++ b/webapp/src/components/NodesList/styles.js @@ -20,6 +20,7 @@ export default (theme) => ({ }, cardRow: { display: 'grid', + gap: theme.spacing(2), gridTemplateColumns: '60px 240px 4fr', alignItems: 'center', width: '100%', diff --git a/webapp/src/components/NonCompliantCard/index.js b/webapp/src/components/NonCompliantCard/index.js deleted file mode 100644 index c156d637c..000000000 --- a/webapp/src/components/NonCompliantCard/index.js +++ /dev/null @@ -1,142 +0,0 @@ -/* eslint camelcase: 0 */ -import React, { memo } from 'react' -import { makeStyles } from '@mui/styles' -import { useTranslation } from 'react-i18next' -import { Link as RouterLink } from 'react-router-dom' -import Link from '@mui/material/Link' -import Typography from '@mui/material/Typography' -import moment from 'moment' - -import { eosConfig, generalConfig } from '../../config' -import { formatWithThousandSeparator } from '../../utils' -import HealthCheck from '../HealthCheck' -import HealthCheckInfo from 'components/HealthCheck/HealthCheckInfo' -import isValidUrl from '../../utils/validate-url' -import VisitSite from 'components/VisitSite' - -import styles from './styles' - -const useStyles = makeStyles(styles) - -const NonCompliantCard = ({ producer, stats }) => { - const classes = useStyles() - const { t } = useTranslation('producerCardComponent') - const { healthLights } = generalConfig - - const getHealthStatus = healthCheck => { - return healthCheck.valid ? healthLights.greenLight : healthLights.redLight - } - - const RowInfo = ({ title, value }) => { - return ( -
- - {title}: - - {value} -
- ) - } - - return ( - <> -
- - {producer.owner} - - {t('noInfo')} - - {t('bpJsonGenerator')} - -
-
- - {t('info')} - -
- - {t('website')}: - - {isValidUrl(producer.url) ? ( - <> - -
- - - -
- - ) : ( - {t('invalidUrl')} - )} -
- {isValidUrl(producer.url) && ( -
- - {t('bpJson')}: - - -
- )} - - -
-
- - {t('dailyRewards')} - - - - - {t('yearlyRewards')} - - - -
- - ) -} - -NonCompliantCard.propTypes = {} - -export default memo(NonCompliantCard) diff --git a/webapp/src/components/NonCompliantCard/styles.js b/webapp/src/components/NonCompliantCard/styles.js deleted file mode 100644 index c44f680e9..000000000 --- a/webapp/src/components/NonCompliantCard/styles.js +++ /dev/null @@ -1,59 +0,0 @@ -export default (theme) => ({ - flex: { - display: 'flex', - flexWrap: 'wrap', - '& .MuiTypography-body1': { - margin: theme.spacing(1), - }, - }, - title: { - fontWeight: 'bold !important', - fontSize: '12px !important', - textTransform: 'uppercase', - }, - bold: { - fontWeight: '600 !important', - }, - text: { - width: '60px', - }, - account: { - display: 'flex', - flexDirection: 'column', - justifyContent: 'center', - alignItems: 'center', - alignSelf: 'center', - [theme.breakpoints.down('sm')]: { - borderBottom: `1px solid ${theme.palette.neutral.main}`, - paddingBottom: theme.spacing(4), - }, - }, - content: { - width: '250px', - height: 'auto', - margin: '0px', - flexGrow: '1', - [theme.breakpoints.down('lg')]: { - width: '150px', - }, - [theme.breakpoints.down('sm')]: { - width: '100%', - }, - }, - borderLine: { - [theme.breakpoints.up('sm')]: { - marginTop: theme.spacing(3), - marginBottom: theme.spacing(3), - borderLeft: `1px solid ${theme.palette.neutral.main}`, - padding: theme.spacing(0, 3, 0), - }, - [theme.breakpoints.down('sm')]: { - marginLeft: theme.spacing(3), - }, - }, - lightIcon: { - '& svg': { - marginLeft: theme.spacing(2), - }, - }, -}) diff --git a/webapp/src/components/NonCompliantRow/index.js b/webapp/src/components/NonCompliantRow/index.js new file mode 100644 index 000000000..7c9cc2e03 --- /dev/null +++ b/webapp/src/components/NonCompliantRow/index.js @@ -0,0 +1,109 @@ +/* eslint camelcase: 0 */ +import React, { memo } from 'react' +import { Link as RouterLink } from 'react-router-dom' +import { makeStyles } from '@mui/styles' +import { useTranslation } from 'react-i18next' +import LanguageIcon from '@mui/icons-material/Language' +import Link from '@mui/material/Link' +import TableCell from '@mui/material/TableCell' +import Typography from '@mui/material/Typography' +import moment from 'moment' + +import { eosConfig, generalConfig } from '../../config' +import { formatWithThousandSeparator } from '../../utils' +import HealthCheck from '../HealthCheck' +import HealthCheckInfo from 'components/HealthCheck/HealthCheckInfo' +import isValidUrl from '../../utils/validate-url' +import VisitSite from 'components/VisitSite' + +import styles from './styles' + +const useStyles = makeStyles(styles) + +const NonCompliantRow = ({ producer, tokenPrice }) => { + const classes = useStyles() + const { t } = useTranslation('producerCardComponent') + const { healthLights } = generalConfig + + const getHealthStatus = healthCheck => { + return healthCheck.valid ? healthLights.greenLight : healthLights.redLight + } + + return ( + <> + + {`${producer.rank}`} + + + + + {producer.owner} + + + + {isValidUrl(producer.url) ? ( + <> + +
+ + + + +
+
+ + + + + ) : ( + + {t('invalidUrl')} + + )} + + {`${formatWithThousandSeparator( + producer.total_votes_eos, + 0, + )}`} + + + {`${moment(producer.last_claim_time).format( + 'll', + )}`} + + + {`${formatWithThousandSeparator( + producer.total_rewards, + 0, + )} ${eosConfig.tokenSymbol}`} + {`$${formatWithThousandSeparator( + producer.total_rewards * tokenPrice, + 0, + )} USD`} + + + {`${formatWithThousandSeparator( + producer.total_rewards * 365, + 0, + )} ${eosConfig.tokenSymbol}`} + {`$${formatWithThousandSeparator( + producer.total_rewards * 365 * tokenPrice, + 0, + )} USD`} + + + ) +} + +NonCompliantRow.propTypes = {} + +export default memo(NonCompliantRow) diff --git a/webapp/src/components/NonCompliantRow/styles.js b/webapp/src/components/NonCompliantRow/styles.js new file mode 100644 index 000000000..a7d652c22 --- /dev/null +++ b/webapp/src/components/NonCompliantRow/styles.js @@ -0,0 +1,18 @@ +export default (theme) => ({ + websiteContainer: { + display: 'flex', + gap: theme.spacing(1), + flexWrap: 'nowrap', + justifyContent: 'center', + alignItems: 'center', + '& div > svg': { + marginTop: theme.spacing(1), + }, + [theme.breakpoints.down('md')]: { + gap: theme.spacing(2), + }, + [theme.breakpoints.down('sm')]: { + gap: theme.spacing(8), + }, + }, +}) diff --git a/webapp/src/components/ProducerName/styles.js b/webapp/src/components/ProducerName/styles.js index c2095e2c0..9dcf88b72 100644 --- a/webapp/src/components/ProducerName/styles.js +++ b/webapp/src/components/ProducerName/styles.js @@ -44,8 +44,8 @@ export default (theme) => ({ }, }, smallAvatar: { - width: '56px', - height: '56px', + width: '40px', + height: '40px', }, bigAvatar: { width: '104px', diff --git a/webapp/src/components/ProducersTable/ProducerRow.js b/webapp/src/components/ProducersTable/ProducerRow.js index 2a2cc9612..4b1dd8c10 100644 --- a/webapp/src/components/ProducersTable/ProducerRow.js +++ b/webapp/src/components/ProducersTable/ProducerRow.js @@ -120,7 +120,7 @@ const ProducerRow = ({ producer, index }) => { {producer?.rank && eosConfig.producerColumns?.includes('rank') && ( {`${producer?.rank}`} diff --git a/webapp/src/components/ProducersTable/index.js b/webapp/src/components/ProducersTable/index.js index 0cf19eb20..359109b1d 100644 --- a/webapp/src/components/ProducersTable/index.js +++ b/webapp/src/components/ProducersTable/index.js @@ -15,11 +15,15 @@ import Typography from '@mui/material/Typography' import { eosConfig } from '../../config' import styles from './styles' -import ProducerRow from './ProducerRow' const useStyles = makeStyles(styles) -const ProducersTable = ({ producers }) => { +const ProducersTable = ({ + columnsNames, + producers, + RowComponent, + RowProps, +}) => { const classes = useStyles() const navigate = useNavigate() const { t } = useTranslation('producerCardComponent') @@ -35,7 +39,7 @@ const ProducersTable = ({ producers }) => { - {eosConfig.producerColumns.map((name) => ( + {columnsNames.map(name => ( {t(name)} @@ -51,7 +55,7 @@ const ProducersTable = ({ producers }) => { className={classes.tableRow} key={`bp-${producer?.owner}-${index}`} > - + ))} diff --git a/webapp/src/components/ProducersTable/styles.js b/webapp/src/components/ProducersTable/styles.js index 41dd51f1f..5c10c09c0 100644 --- a/webapp/src/components/ProducersTable/styles.js +++ b/webapp/src/components/ProducersTable/styles.js @@ -14,12 +14,15 @@ export default (theme) => ({ }, tableRow: { '& .MuiTableCell-root': { - padding: `${theme.spacing(1, 2)} !important`, + padding: `${theme.spacing(2)} !important`, }, '&:hover': { backgroundColor: `${theme.palette.neutral.lighter}`, cursor: 'pointer', }, + '& a': { + margin: 0, + }, }, tableHead: { borderBottom: `2px solid ${theme.palette.primary.main} !important`, @@ -44,11 +47,6 @@ export default (theme) => ({ textOverflow: 'ellipsis', width: '140px', }, - [theme.breakpoints.down('md')]: { - '& > a': { - margin: 0, - }, - }, }, countryContainer: { [theme.breakpoints.down('md')]: { diff --git a/webapp/src/language/en.json b/webapp/src/language/en.json index e05dff783..075b3e3cf 100644 --- a/webapp/src/language/en.json +++ b/webapp/src/language/en.json @@ -214,7 +214,12 @@ "rewards": "Rewards", "rewardsPercentage": "Percentage of rewards", "viewList": "View full list", - "paidProducersText": "Daily Rewards" + "paidProducersText": "Daily Rewards", + "publishBPDetails": "Publish BP Details", + "generateBPjson": "Generate a BP.json", + "tooltip": { + "generateBPjson": "BPs can easily create and update their bp.json for transparency." + } }, "nodesRoute": {}, "nodesDistributionRoute": {}, @@ -328,15 +333,7 @@ "rewards": "Rewards", "country": "Country", "eosRate": "EOS RATE", - "p2pEndpoints": "Endpoints (P2P)", - "apiEndpoints": "Endpoints (HTTPS / HTTPS)", - "pingFromCostaRica": "Ping from Costa Rica", - "serverVersion": "Server version", - "secondsAgo": "s ago", - "lastChecked": "Last Checked", "missedBlocks": "Missed Blocks", - "businessContact": "Business Contact", - "technicalContact": "Technical Contact", "social": "Social", "ownershipDisclosure": "Ownership Disclosure", "codeofconduct": "Code of Conduct", @@ -346,31 +343,24 @@ "features": "Features", "endpoints": "Endpoints", "nodeVersion": "Version", - "emptyNode": "Empty info for nodes", "cpuBenchmark": "CPU Benchmark Average", "health": "Compliance", - "collapse": "Collapse", "moreInfo": "More Info", "version": "Version", "info": "Info", "keys": "Keys", "location": "Location", "stats": "Stats", - "noData": "No Data", "peer_keys": "Peer Key", - "account_key": "Account Key", - "hs_bpJson": "BP JSON", "emptyState": "This block producer does not provide any information.", "average": "average rating", "ratings": "ratings", "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", - "bpJsonGenerator": "BP JSON Generator", "viewProfile": "View BP Profile", "BPonNetwork": "{{position}} Block Producer on {{networkName}}", "generalInformation": "General Information", diff --git a/webapp/src/language/es.json b/webapp/src/language/es.json index df2e2d029..7df2b3ce1 100644 --- a/webapp/src/language/es.json +++ b/webapp/src/language/es.json @@ -218,7 +218,12 @@ "rewards": "Recompensas", "rewardsPercentage": "Porcentaje de recompensas", "viewList": "Ver lista completa", - "paidProducersText": "Recompensas Diarias" + "paidProducersText": "Recompensas Diarias", + "publishBPDetails": "Publicar datos de BP", + "generateBPjson": "Generar un BP.json", + "tooltip": { + "generateBPjson": "BPs pueden fácilmente crear y actualizar sus bp.json para ser transparentes." + } }, "nodesRoute": {}, "nodesDistributionRoute": {}, @@ -329,15 +334,7 @@ "rewards": "Recompensas", "country": "País", "eosRate": "EOS RATE", - "p2pEndpoints": "(P2P)", - "apiEndpoints": "(HTTPS / HTTPS)", - "pingFromCostaRica": "Ping desde Costa Rica", - "serverVersion": "Versión del servidor", - "secondsAgo": "s atras", - "lastChecked": "Verificado por última vez", "missedBlocks": "Bloques perdidos", - "businessContact": "Contacto del negocio", - "technicalContact": "Contacto técnico", "social": "Social", "ownershipDisclosure": "Divulgación de propiedad", "codeofconduct": "Código de conducta", @@ -347,31 +344,24 @@ "features": "Características", "endpoints": "Endpoints", "nodeVersion": "Versión", - "emptyNode": "Sin información para nodos", "cpuBenchmark": "Promedio del Benchmark de CPU", "health": "Cumplimiento", - "collapse": "Colapsar", "moreInfo": "Más Información", "version": "Versión", "info": "Info", "keys": "Llaves", "location": "Ubicación", "stats": "Estadísticas", - "noData": "No hay Datos", "peer_keys": "Peer", - "account_key": "Cuenta", - "hs_bpJson": "BP Json", "emptyState": "Este productor de bloques no proporciona ninguna información.", "average": "calificación promedio", "ratings": "calificaciones", "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", - "bpJsonGenerator": "Generar BP JSON", "viewProfile": "Ver Perfil del BP", "BPonNetwork": "{{position}} Productor de Bloques en {{networkName}}", "generalInformation": "Información General", diff --git a/webapp/src/routes/BPJson/useBPJsonState.js b/webapp/src/routes/BPJson/useBPJsonState.js index b63314c3c..0600eb609 100644 --- a/webapp/src/routes/BPJson/useBPJsonState.js +++ b/webapp/src/routes/BPJson/useBPJsonState.js @@ -1,5 +1,4 @@ import { useEffect, useState } from 'react' -import { useLocation } from 'react-router-dom' import EosApi from 'eosjs-api' import axios from 'axios' import { useTranslation } from 'react-i18next' @@ -78,7 +77,7 @@ const getBpJSONChain = async (producer) => { } const useBPJsonState = () => { - const emptyBPJson = { + const initData = { account_name: '', org: { candidate_name: '', @@ -119,24 +118,10 @@ const useBPJsonState = () => { const [{ ual }] = useSharedState() const { t } = useTranslation('bpJsonRoute') - const location = useLocation() const [producer, setProducer] = useState(null) const [loading, setLoading] = useState(true) const [error, setError] = useState(null) const [inconsistencyMessage, setInconsistencyMessage] = useState(null) - const [initData, setInitData] = useState(emptyBPJson) - - useEffect(() => { - setInitData((prev) => ({ - ...prev, - org: { - ...prev.org, - candidate_name: location.state?.owner || '', - website: location.state?.url, - }, - })) - window.history.replaceState({}, document.title) - }, [location, setInitData]) const handleOnSubmit = async (payload) => { if (!ual.activeUser || !payload) return diff --git a/webapp/src/routes/BlockProducers/index.js b/webapp/src/routes/BlockProducers/index.js index 7b5a6d2d0..79565bc62 100644 --- a/webapp/src/routes/BlockProducers/index.js +++ b/webapp/src/routes/BlockProducers/index.js @@ -14,6 +14,7 @@ import useBlockProducerState from '../../hooks/customHooks/useBlockProducerState import NoResults from '../../components/NoResults' import ProducersUpdateLog from '../../components/ProducersUpdateLog' import ProducersTable from '../../components/ProducersTable' +import ProducerRow from '../../components/ProducersTable/ProducerRow' import styles from './styles' @@ -80,7 +81,11 @@ const Producers = () => { ) : !!items?.length ? ( <> - + { ) : ( )} - ) } diff --git a/webapp/src/routes/NonCompliantBPs/RewardsStats.js b/webapp/src/routes/NonCompliantBPs/RewardsStats.js index 38c3493ee..b256455be 100644 --- a/webapp/src/routes/NonCompliantBPs/RewardsStats.js +++ b/webapp/src/routes/NonCompliantBPs/RewardsStats.js @@ -1,7 +1,9 @@ /* eslint camelcase: 0 */ import React, { memo } from 'react' +import { Link } from 'react-router-dom' import { makeStyles } from '@mui/styles' import { useTranslation } from 'react-i18next' +import Button from '@mui/material/Button' import Typography from '@mui/material/Typography' import { eosConfig } from '../../config' @@ -17,7 +19,7 @@ const RewardsStats = ({ stats }) => { const { t } = useTranslation('rewardsDistributionRoute') return ( - <> +
@@ -62,7 +64,21 @@ const RewardsStats = ({ stats }) => {
- + +
+ +
+
+
) } diff --git a/webapp/src/routes/NonCompliantBPs/index.js b/webapp/src/routes/NonCompliantBPs/index.js index 72711967c..d553f4b00 100644 --- a/webapp/src/routes/NonCompliantBPs/index.js +++ b/webapp/src/routes/NonCompliantBPs/index.js @@ -1,21 +1,27 @@ /* eslint camelcase: 0 */ import React, { memo } from 'react' -import { makeStyles } from '@mui/styles' import Card from '@mui/material/Card' import LinearProgress from '@mui/material/LinearProgress' import useNonCompliantState from '../../hooks/customHooks/useNonCompliantState' import NoResults from '../../components/NoResults' -import NonCompliantCard from '../../components/NonCompliantCard' +import ProducersTable from '../../components/ProducersTable' +import NonCompliantRow from '../../components/NonCompliantRow' -import styles from './styles' import RewardsStats from './RewardsStats' -const useStyles = makeStyles(styles) - const NonCompliantBPs = () => { - const classes = useStyles() const [{ items, stats, loading }] = useNonCompliantState() + const columnsNames = [ + 'rank', + 'producerName', + 'website', + 'bpJson', + 'votes', + 'lastClaimTime', + 'dailyRewards', + 'yearlyRewards', + ] return ( <> @@ -25,22 +31,18 @@ const NonCompliantBPs = () => { <> {!!items?.length && stats ? ( <> -
- -
-
- {items.map((producer, index) => ( - - - - ))} -
+ + + + ) : ( - + )} )} diff --git a/webapp/src/routes/NonCompliantBPs/styles.js b/webapp/src/routes/NonCompliantBPs/styles.js index 5f6343dc2..3be65d110 100644 --- a/webapp/src/routes/NonCompliantBPs/styles.js +++ b/webapp/src/routes/NonCompliantBPs/styles.js @@ -9,13 +9,10 @@ export default (theme) => ({ display: 'flex', flexFlow: 'row nowrap', gap: theme.spacing(6), - margin: `${theme.spacing(6)} 24px ${theme.spacing(4)}`, + margin: theme.spacing(6, 0, 4), paddingBottom: theme.spacing(4), borderBottom: `1px solid ${theme.palette.neutral.light}`, - [theme.breakpoints.down('lg')]: { - margin: theme.spacing(6, 0, 4), - }, - [theme.breakpoints.down('sm')]: { + [theme.breakpoints.down('md')]: { flexFlow: 'row wrap', gap: theme.spacing(2), }, @@ -25,39 +22,10 @@ export default (theme) => ({ display: 'flex', flexDirection: 'column', justifyContent: 'center', - [theme.breakpoints.down('sm')]: { + alignItems: 'center', + [theme.breakpoints.down('md')]: { minWidth: '150px', minHeight: '55px', } }, - bpsContainer: { - display: 'grid', - gap: theme.spacing(4, 6), - gridTemplateColumns: - 'repeat(auto-fit, minmax( min( calc( 50% - 100px ), 600px ), auto))', - margin: '0 24px', - [theme.breakpoints.down('lg')]: { - margin: '0', - gridTemplateColumns: 'repeat(auto-fit, minmax(500px, auto))', - }, - [theme.breakpoints.down('sm')]: { - gridTemplateColumns: 'repeat(auto-fit, minmax(200px, auto))', - }, - }, - card: { - display: 'flex', - flexFlow: 'row nowrap', - minHeight: '125px', - '& .MuiTypography-h6': { - display: 'flex', - }, - [theme.breakpoints.down('md')]: { - justifyContent: 'center', - }, - [theme.breakpoints.down('sm')]: { - flex: 'auto', - flexDirection: 'column', - padding: theme.spacing(3), - }, - }, }) diff --git a/webapp/src/routes/ProducerProfile/index.js b/webapp/src/routes/ProducerProfile/index.js index 5d9c1445b..e54ac3af2 100644 --- a/webapp/src/routes/ProducerProfile/index.js +++ b/webapp/src/routes/ProducerProfile/index.js @@ -15,9 +15,7 @@ import useProducerProfileState from './useProducerProfileState' import styles from './styles' const NodesCard = lazy(() => import('./../../components/NodeCard/NodesCard')) -const EmptyState = lazy(() => - import('./../../components/EmptyState'), -) +const EmptyState = lazy(() => import('./../../components/EmptyState')) const useStyles = makeStyles(styles) @@ -63,13 +61,13 @@ const ProducerProfile = () => { ldJson={ldJson} /> - + {producer?.hasEmptyBPJson && ( }> - + 0} /> )} diff --git a/webapp/src/theme/components.js b/webapp/src/theme/components.js index 3eb9aa24b..4967da2ad 100644 --- a/webapp/src/theme/components.js +++ b/webapp/src/theme/components.js @@ -46,6 +46,13 @@ const components = { }, }, }, + MuiTooltip: { + styleOverrides: { + tooltip: { + backgroundColor: '#616161', + }, + }, + }, } export default components