Skip to content

Commit 3000e6d

Browse files
Hide the Era Points from the validator page (#48)
* Hide the Era Points from the validator page * A0-3205: Simplify hide era points chart --------- Co-authored-by: Wojciech Basiura <[email protected]>
1 parent c2ea3b9 commit 3000e6d

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

packages/page-staking/src/Query/Validator.tsx

+13-7
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,40 @@ import type { Props } from './types.js';
66
import React from 'react';
77

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

1011
import ChartPoints from './ChartPoints.js';
1112
import ChartPrefs from './ChartPrefs.js';
1213
import ChartRewards from './ChartRewards.js';
1314
import ChartStake from './ChartStake.js';
1415

1516
function Validator ({ className = '', labels, validatorId }: Props): React.ReactElement<Props> | null {
17+
const { systemChain } = useApi();
18+
const isAlephChain = systemChain.includes('Aleph Zero');
19+
1620
return (
1721
<StyledColumar className={className}>
1822
<Columar.Column>
19-
<ChartPoints
23+
<ChartStake
2024
labels={labels}
2125
validatorId={validatorId}
2226
/>
23-
<ChartRewards
27+
<ChartPrefs
2428
labels={labels}
2529
validatorId={validatorId}
2630
/>
2731
</Columar.Column>
2832
<Columar.Column>
29-
<ChartStake
30-
labels={labels}
31-
validatorId={validatorId}
32-
/>
33-
<ChartPrefs
33+
<ChartRewards
3434
labels={labels}
3535
validatorId={validatorId}
3636
/>
37+
{!isAlephChain && (
38+
<ChartPoints
39+
labels={labels}
40+
validatorId={validatorId}
41+
/>
42+
)}
3743
</Columar.Column>
3844
</StyledColumar>
3945
);

0 commit comments

Comments
 (0)