Skip to content

Commit

Permalink
Merge pull request #296 from pshenmic/feat/validator-page
Browse files Browse the repository at this point in the history
Update Validator page
  • Loading branch information
pshenmic authored Oct 23, 2024
2 parents 824d974 + 751cfc8 commit 980b4d2
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 5 deletions.
17 changes: 14 additions & 3 deletions packages/frontend/src/app/validator/[hash]/Validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import BlocksList from '../../../components/blocks/BlocksList'
import TransactionsList from '../../../components/transactions/TransactionsList'
import BlocksChart from './BlocksChart'
import Link from 'next/link'
import { Identifier, DateBlock, Endpoint, IpAddress, InfoLine } from '../../../components/data'
import { Identifier, DateBlock, Endpoint, IpAddress, InfoLine, Credits } from '../../../components/data'
import { ValueContainer, PageDataContainer, InfoContainer } from '../../../components/ui/containers'
import { HorisontalSeparator } from '../../../components/ui/separators'
import { ValidatorCard } from '../../../components/validators'
Expand Down Expand Up @@ -205,7 +205,9 @@ function Validator ({ hash }) {
title={'Rewards This Epoch'}
value={(
<RateTooltip credits={validator.data?.epochReward} rate={rate.data}>
<span>{validator.data?.epochReward}</span>
<span>
<Credits>{validator.data?.epochReward}</Credits>
</span>
</RateTooltip>
)}
loading={validator.loading}
Expand All @@ -216,12 +218,21 @@ function Validator ({ hash }) {
title={'Total Rewards Earned'}
value={(
<RateTooltip credits={validator.data?.totalReward} rate={rate.data}>
<span>{validator.data?.totalReward}</span>
<span>
<Credits>{validator.data?.totalReward}</Credits>
</span>
</RateTooltip>
)}
loading={validator.loading}
error={validator.error || !(typeof validator.data?.totalReward === 'number')}
/>
<InfoLine
className={'ValidatorPage__InfoLine'}
title={'Blocks proposed'}
value={validator.data?.proposedBlocksAmount}
loading={validator.loading}
error={validator.error || typeof validator.data?.proposedBlocksAmount !== 'number'}
/>
<InfoLine
className={'ValidatorPage__InfoLine'}
title={'Last Proposed Block'}
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/src/components/blocks/BlocksList.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ function BlocksList ({ blocks = [], columnsCount = 1, size = 'l', headerStyles =
<GridItem className={'BlocksList__ColumnTitle'}>
Height
</GridItem>
<GridItem className={'BlocksList__ColumnTitle'}>
<GridItem className={'BlocksList__ColumnTitle BlocksList__ColumnTitle--Time'}>
Time
</GridItem>
<GridItem className={'BlocksList__ColumnTitle BlocksList__ColumnTitle--Hash'}>
Block Hash
</GridItem>
<GridItem className={'BlocksList__ColumnTitle'}>
<GridItem className={'BlocksList__ColumnTitle BlocksList__ColumnTitle--Txs'}>
TXs count
</GridItem>
</Grid>
Expand Down
21 changes: 21 additions & 0 deletions packages/frontend/src/components/blocks/BlocksList.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,25 @@
text-align: right;
}
}

@media screen and (max-width: 620px) {
&__ColumnTitles {
grid-template-columns: 70px 90px calc(100% - 160px);
}

&__ColumnTitle {
&--Hash {
display: none;
}

&--Txs {
order: 0;
text-align: left !important;
}

&--Time {
order: 2;
}
}
}
}

0 comments on commit 980b4d2

Please sign in to comment.