From 84d9dc415319c73e004c5555b48d098147d5aff7 Mon Sep 17 00:00:00 2001 From: Daria Mikhailova Date: Fri, 27 Sep 2024 10:25:42 +0800 Subject: [PATCH 1/2] showing discord, github and matrix --- .../src/AccountSidebar/Identity.tsx | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/packages/react-components/src/AccountSidebar/Identity.tsx b/packages/react-components/src/AccountSidebar/Identity.tsx index 9befc10bc10d..e4b1638e3f00 100644 --- a/packages/react-components/src/AccountSidebar/Identity.tsx +++ b/packages/react-components/src/AccountSidebar/Identity.tsx @@ -6,7 +6,6 @@ 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 { isHex } from '@polkadot/util'; import AddressMini from '../AddressMini.js'; @@ -142,11 +141,27 @@ function Identity ({ address, identity }: Props): React.ReactElement | nu )} - {identity.other && AddressIdentityOtherDiscordKey in identity.other && ( + {identity.discord && (
{t('discord')}
- {identity.other[AddressIdentityOtherDiscordKey]} + {identity.discord} +
+
+ )} + {identity.github && ( +
+
{t('github')}
+
+ {identity.github} +
+
+ )} + {identity.matrix && ( +
+
{t('matrix')}
+
+ {identity.matrix}
)} From 1bf347b6172471f212d9d1d623b4a5d45687c010 Mon Sep 17 00:00:00 2001 From: Daria Mikhailova Date: Mon, 30 Sep 2024 14:19:02 +0800 Subject: [PATCH 2/2] restored other attribute for backwards compatibility --- .../src/AccountSidebar/Identity.tsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/react-components/src/AccountSidebar/Identity.tsx b/packages/react-components/src/AccountSidebar/Identity.tsx index e4b1638e3f00..0bf29b9afa1e 100644 --- a/packages/react-components/src/AccountSidebar/Identity.tsx +++ b/packages/react-components/src/AccountSidebar/Identity.tsx @@ -1,11 +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 { type AddressIdentity, AddressIdentityOtherDiscordKey } from '@polkadot/react-hooks/types'; import { isHex } from '@polkadot/util'; import AddressMini from '../AddressMini.js'; @@ -141,11 +140,11 @@ function Identity ({ address, identity }: Props): React.ReactElement | nu )} - {identity.discord && ( + {identity.other && AddressIdentityOtherDiscordKey in identity.other && (
{t('discord')}
- {identity.discord} + {identity.other[AddressIdentityOtherDiscordKey]}
)} @@ -165,6 +164,14 @@ function Identity ({ address, identity }: Props): React.ReactElement | nu )} + {identity.discord && ( +
+
{t('discord')}
+
+ {identity.discord} +
+
+ )} {identity.riot && (
{t('riot')}