Ensure bad judgement has the highest priority (#4178)
This commit is contained in:
parent
6ba7a8c716
commit
2e6cbe8f7c
@ -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} </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')
|
||||
}
|
||||
</>
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user