Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Validator page #296

Merged
merged 3 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}
}
}
Loading