Reflecting changes to Identity pallet (#10959)

* showing discord, github and matrix

* restored other attribute for backwards compatibility
This commit is contained in:
Daria 2024-09-30 19:01:06 +08:00 committed by GitHub
parent 24c2d7c007
commit 4e80393ba9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,12 +1,10 @@
// Copyright 2017-2024 @polkadot/react-components authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { AddressIdentity } from '@polkadot/react-hooks/types';
import React, { useMemo } from 'react';
import { useApi, useRegistrars, useSubidentities, useToggle } from '@polkadot/react-hooks';
import { AddressIdentityOtherDiscordKey } from '@polkadot/react-hooks/types';
import { type AddressIdentity, AddressIdentityOtherDiscordKey } from '@polkadot/react-hooks/types';
import { isHex } from '@polkadot/util';
import AddressMini from '../AddressMini.js';
@ -150,6 +148,30 @@ function Identity ({ address, identity }: Props): React.ReactElement<Props> | nu
</div>
</div>
)}
{identity.github && (
<div className='tr'>
<div className='th'>{t('github')}</div>
<div className='td'>
{identity.github}
</div>
</div>
)}
{identity.matrix && (
<div className='tr'>
<div className='th'>{t('matrix')}</div>
<div className='td'>
{identity.matrix}
</div>
</div>
)}
{identity.discord && (
<div className='tr'>
<div className='th'>{t('discord')}</div>
<div className='td'>
{identity.discord}
</div>
</div>
)}
{identity.riot && (
<div className='tr'>
<div className='th'>{t('riot')}</div>