Skip to content

Commit

Permalink
Hide the Era Points from the validator page (#48)
Browse files Browse the repository at this point in the history
* Hide the Era Points from the validator page

* A0-3205: Simplify hide era points chart

---------

Co-authored-by: Wojciech Basiura <basiura.wojciech@gmail.com>
  • Loading branch information
piotrMocz and youPickItUp authored Sep 13, 2023
1 parent c2ea3b9 commit 3000e6d
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions packages/page-staking/src/Query/Validator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,40 @@ import type { Props } from './types.js';
import React from 'react';

import { Columar, styled } from '@polkadot/react-components';
import { useApi } from '@polkadot/react-hooks';

import ChartPoints from './ChartPoints.js';
import ChartPrefs from './ChartPrefs.js';
import ChartRewards from './ChartRewards.js';
import ChartStake from './ChartStake.js';

function Validator ({ className = '', labels, validatorId }: Props): React.ReactElement<Props> | null {
const { systemChain } = useApi();
const isAlephChain = systemChain.includes('Aleph Zero');

return (
<StyledColumar className={className}>
<Columar.Column>
<ChartPoints
<ChartStake
labels={labels}
validatorId={validatorId}
/>
<ChartRewards
<ChartPrefs
labels={labels}
validatorId={validatorId}
/>
</Columar.Column>
<Columar.Column>
<ChartStake
labels={labels}
validatorId={validatorId}
/>
<ChartPrefs
<ChartRewards
labels={labels}
validatorId={validatorId}
/>
{!isAlephChain && (
<ChartPoints
labels={labels}
validatorId={validatorId}
/>
)}
</Columar.Column>
</StyledColumar>
);
Expand Down

0 comments on commit 3000e6d

Please sign in to comment.