Staking ledgend v1 (#3564)

* Staking ledgend v1

* Re-add clickable icon spacing
This commit is contained in:
Jaco Greeff 2020-08-29 10:56:10 +02:00 committed by GitHub
parent ceb88a10f0
commit 28dbe3d104
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 81 additions and 1 deletions

View File

@ -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>
);

View 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;
}
`);

View File

@ -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;
}