Ensure bad judgement has the highest priority (#4178)

This commit is contained in:
Jaco Greeff 2020-12-08 21:36:54 +01:00 committed by GitHub
parent 6ba7a8c716
commit 2e6cbe8f7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 11 deletions

View File

@ -40,10 +40,10 @@ function Identity ({ address, identity }: Props): React.ReactElement<Props> | nu
</div>
<Tag
color={
identity.isGood
? 'green'
: identity.isBad
? 'red'
identity.isBad
? 'red'
: identity.isGood
? 'green'
: 'yellow'
}
isTag={false}
@ -52,10 +52,13 @@ function Identity ({ address, identity }: Props): React.ReactElement<Props> | nu
<b>{identity.judgements.length}&nbsp;</b>
{
identity.judgements.length
? (identity.isGood
? (identity.isKnownGood ? t<string>('Known good') : t<string>('Reasonable'))
: (identity.isErroneous ? t<string>('Erroneous') : t<string>('Low quality'))
)
? identity.isBad
? identity.isErroneous
? t<string>('Erroneous')
: t<string>('Low quality')
: identity.isKnownGood
? t<string>('Known good')
: t<string>('Reasonable')
: t<string>('No judgments')
}
</>

View File

@ -118,12 +118,12 @@ function extractIdentity (address: string, identity: DeriveAccountRegistration):
: identity.displayParent.replace(/[^\x20-\x7E]/g, '')
);
const elem = createIdElem(
<span className={`name${isGood ? ' isGood' : ''}`}>
<span className={`name${isGood && !isBad ? ' isGood' : ''}`}>
<span className='top'>{displayParent || displayName}</span>
{displayParent && <span className='sub'>{`/${displayName || ''}`}</span>}
</span>,
isGood ? 'green' : (isBad ? 'red' : 'gray'),
identity.parent ? 'link' : (isGood ? 'check' : 'minus')
(isBad ? 'red' : (isGood ? 'green' : 'gray')),
identity.parent ? 'link' : (isGood && !isBad ? 'check' : 'minus')
);
displayCache.set(address, elem);