Skip to content

Commit

Permalink
feat(webapp): add link to the second block in the ATH card
Browse files Browse the repository at this point in the history
  • Loading branch information
Torresmorah committed Jul 13, 2023
1 parent 71ff92a commit cbfda5d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
20 changes: 7 additions & 13 deletions webapp/src/components/TransactionsHistory/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ import styles from './styles'

const useStyles = makeStyles(styles)

const BodyGraphValue = ({ loading, value, classes, href }) => {
const BodyGraphValue = ({ loading, value, classes, links }) => {
if (loading) return <LinearProgress />

return (
<Typography component="p" variant="h6">
{value}
{href && (
<a href={href} target="_blank" rel="noopener noreferrer">
{links && links.map((href, index) => (
<a key={`link-body-graph-${index}`} href={href} target="_blank" rel="noopener noreferrer">
<LaunchIcon className={classes.svgLink} color="primary" />
</a>
)}
))}
</Typography>
)
}
Expand Down Expand Up @@ -60,19 +60,15 @@ const TransactionsHistory = ({ t, nodesChildren }) => {
value={data?.stats[0]?.tps_all_time_high?.transactions_count}
loading={loading}
classes={classes}
href={getBlockNumUrl(
data?.stats?.[0]?.tps_all_time_high?.blocks[0],
)}
links={data?.stats?.[0]?.tps_all_time_high?.blocks.map(block => getBlockNumUrl(block))}
/>
</SimpleDataCard>
<SimpleDataCard>
<Typography>{t('cpuUtilizationAllTimeHigh')}</Typography>
<BodyGraphValue
value={`${data?.stats[0]?.tps_all_time_high?.cpu_usage || 0} %`}
classes={classes}
href={getBlockNumUrl(
data?.stats?.[0]?.tps_all_time_high?.blocks[0],
)}
links={data?.stats?.[0]?.tps_all_time_high?.blocks.map(block => getBlockNumUrl(block))}
loading={loading}
/>
</SimpleDataCard>
Expand All @@ -81,9 +77,7 @@ const TransactionsHistory = ({ t, nodesChildren }) => {
<BodyGraphValue
value={`${data?.stats[0]?.tps_all_time_high?.net_usage || 0} %`}
classes={classes}
href={getBlockNumUrl(
data?.stats?.[0]?.tps_all_time_high?.blocks[0],
)}
links={data?.stats?.[0]?.tps_all_time_high?.blocks.map(block => getBlockNumUrl(block))}
loading={loading}
/>
</SimpleDataCard>
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/language/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@
"tpsAllTimeHigh": "TPS All Time High",
"cpuUtilization": "CPU Usage",
"netUtilization": "NET Usage",
"cpuUtilizationAllTimeHigh": "CPU Usage All Time High",
"networkUtilizationAllTimeHigh": "NET Usage All Time High",
"cpuUtilizationAllTimeHigh": "CPU Usage in TPS All Time High",
"networkUtilizationAllTimeHigh": "NET Usage in TPS All Time High",
"transactionsPerSecond": "Transactions per Second",
"transactionsPerBlock": "Transactions per Block",
"nodes": "Nodes",
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/language/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@
"secondsAgo": "Hace Segundos",
"cpuUtilization": "Uso de CPU",
"netUtilization": "Uso de NET",
"cpuUtilizationAllTimeHigh": "Máxima uso de CPU",
"networkUtilizationAllTimeHigh": "Máxima uso de NET",
"cpuUtilizationAllTimeHigh": "Uso de CPU en TPS máximo histórico",
"networkUtilizationAllTimeHigh": "Uso de NET en TPS máximo histórico",
"tpsAllTimeHigh": "TPS máximo histórico",
"transactionsPerSecond": "Transacciones por segundo",
"transactionsPerBlock": "Transacciones por bloque",
Expand Down

0 comments on commit cbfda5d

Please sign in to comment.