Staking ledgend v1 (#3564)
* Staking ledgend v1 * Re-add clickable icon spacing
This commit is contained in:
parent
ceb88a10f0
commit
28dbe3d104
@ -9,6 +9,7 @@ import { useApi } from '@polkadot/react-hooks';
|
||||
import { isString } from '@polkadot/util';
|
||||
|
||||
import { useTranslation } from './translate';
|
||||
import Ledgend from './Ledgend';
|
||||
|
||||
interface Props {
|
||||
children?: React.ReactNode;
|
||||
@ -52,6 +53,7 @@ function Filtering ({ children, className, nameFilter, setNameFilter, setWithIde
|
||||
value={withIdentity}
|
||||
/>
|
||||
)}
|
||||
<Ledgend />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
78
packages/page-staking/src/Ledgend.tsx
Normal file
78
packages/page-staking/src/Ledgend.tsx
Normal file
@ -0,0 +1,78 @@
|
||||
// Copyright 2017-2020 @polkadot/app-staking authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import React from 'react';
|
||||
import styled from 'styled-components';
|
||||
import { Badge, Icon } from '@polkadot/react-components';
|
||||
|
||||
import { useTranslation } from './translate';
|
||||
|
||||
interface Props {
|
||||
className?: string;
|
||||
}
|
||||
|
||||
function Ledgend ({ className }: Props): React.ReactElement<Props> {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<div className={className}>
|
||||
<span>
|
||||
<Badge
|
||||
color='blue'
|
||||
icon='chevron-right'
|
||||
/>
|
||||
{t('Next session')}
|
||||
</span>
|
||||
<span>
|
||||
<Badge
|
||||
color='green'
|
||||
info='5'
|
||||
/>
|
||||
{t('Produced blocks')}
|
||||
</span>
|
||||
<span>
|
||||
<Badge
|
||||
color='green'
|
||||
info={<Icon icon='envelope' />}
|
||||
/>
|
||||
{t('Online message')}
|
||||
</span>
|
||||
<span>
|
||||
<Badge
|
||||
color='green'
|
||||
icon='hand-paper'
|
||||
/>
|
||||
{t('Nominating')}
|
||||
</span>
|
||||
<span>
|
||||
<Badge
|
||||
color='red'
|
||||
info='64'
|
||||
/>
|
||||
{t('Oversubscribed')}
|
||||
</span>
|
||||
<span>
|
||||
<Badge
|
||||
color='red'
|
||||
icon='skull-crossbones'
|
||||
/>
|
||||
{t('Slashed')}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default React.memo(styled(Ledgend)`
|
||||
font-size: 0.85rem;
|
||||
padding: 1rem 0.5rem 0.5rem;
|
||||
text-align: center;
|
||||
|
||||
.ui--Badge {
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
|
||||
span+span {
|
||||
margin-left: 1rem;
|
||||
}
|
||||
`);
|
||||
@ -225,7 +225,7 @@ function Targets ({ className = '', isInElection, ownStashes, targets: { avgStak
|
||||
export default React.memo(styled(Targets)`
|
||||
text-align: center;
|
||||
|
||||
th {
|
||||
th.isClickable {
|
||||
.ui--Icon {
|
||||
margin-left: 0.5rem;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user