Fix Address icon display (#4761)
This commit is contained in:
parent
21b939dcc8
commit
8623cd3506
@ -66,10 +66,10 @@
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.13.8",
|
||||
"@babel/register": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@pinata/sdk": "^1.1.12",
|
||||
"@polkadot/dev": "^0.61.30",
|
||||
"@polkadot/ts": "^0.3.59",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@pinata/sdk": "^1.1.13",
|
||||
"@polkadot/dev": "^0.61.31",
|
||||
"@polkadot/ts": "^0.3.60",
|
||||
"@types/bn.js": "^4.11.6",
|
||||
"@types/chart.js": "^2.9.31",
|
||||
"@types/file-saver": "^2.0.1",
|
||||
|
||||
@ -10,18 +10,18 @@
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@acala-network/type-definitions": "^0.6.2-12",
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@darwinia/types": "^1.1.0-alpha.1",
|
||||
"@edgeware/node-types": "^3.3.2",
|
||||
"@interlay/polkabtc-types": "^0.5.2",
|
||||
"@laminar/type-definitions": "^0.3.1",
|
||||
"@polkadot/networks": "^5.9.3-0",
|
||||
"@snowfork/snowbridge-types": "^0.2.3",
|
||||
"@sora-substrate/type-definitions": "^0.4.8",
|
||||
"@sora-substrate/type-definitions": "^0.4.9",
|
||||
"@subsocial/types": "^0.4.33-w3f-grant2",
|
||||
"moonbeam-types-bundle": "1.1.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"i18next": "^19.9.0"
|
||||
"i18next": "^19.9.1"
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.13.8",
|
||||
"@babel/polyfill": "^7.12.1",
|
||||
"@polkadot/dev": "^0.61.30",
|
||||
"@polkadot/dev": "^0.61.31",
|
||||
"@polkadot/react-components": "^0.82.2-3",
|
||||
"electron-log": "^4.3.1",
|
||||
"electron-updater": "^4.3.7"
|
||||
|
||||
@ -9,6 +9,6 @@
|
||||
"contributors": [],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8"
|
||||
"@babel/runtime": "^7.13.9"
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,10 +13,10 @@
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.13.8",
|
||||
"@babel/polyfill": "^7.12.1",
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/apps-config": "^0.82.2-3",
|
||||
"@polkadot/apps-routing": "^0.82.2-3",
|
||||
"@polkadot/dev": "^0.61.30",
|
||||
"@polkadot/dev": "^0.61.31",
|
||||
"@polkadot/react-api": "^0.82.2-3",
|
||||
"@polkadot/react-components": "^0.82.2-3",
|
||||
"@polkadot/react-hooks": "^0.82.2-3",
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
"contributors": [],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/phishing": "^0.6.2",
|
||||
"@polkadot/react-components": "^0.82.2-3",
|
||||
"@polkadot/vanitygen": "^0.30.1",
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
"contributors": [],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/react-components": "^0.82.2-3",
|
||||
"file-saver": "^2.0.5"
|
||||
},
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
"maintainers": [],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/react-components": "^0.82.2-3"
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
"maintainers": [],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/react-components": "^0.82.2-3"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
"maintainers": [],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/react-components": "^0.82.2-3"
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/react-components": "^0.82.2-3",
|
||||
"secp256k1": "^3.8.0"
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
"maintainers": [],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/api-contract": "^3.11.2-3"
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
"maintainers": [],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/react-components": "^0.82.2-3",
|
||||
"@polkadot/react-query": "^0.82.2-3"
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
"maintainers": [],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/react-components": "^0.82.2-3"
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
"maintainers": [],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/react-components": "^0.82.2-3",
|
||||
"@polkadot/react-query": "^0.82.2-3"
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
"contributors": [],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/react-components": "^0.82.2-3"
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
"contributors": [],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/react-components": "^0.82.2-3",
|
||||
"@polkadot/react-params": "^0.82.2-3",
|
||||
"@polkadot/react-signer": "^0.82.2-3"
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
"maintainers": [],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/react-components": "^0.82.2-3"
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
"maintainers": [],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/react-components": "^0.82.2-3",
|
||||
"@polkadot/react-query": "^0.82.2-3"
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
"maintainers": [],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/react-components": "^0.82.2-3"
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
"contributors": [],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/react-components": "^0.82.2-3"
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
"maintainers": [],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/apps-config": "^0.82.2-3",
|
||||
"@polkadot/react-components": "^0.82.2-3",
|
||||
"@polkadot/react-query": "^0.82.2-3",
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
"contributors": [],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/react-components": "^0.82.2-3"
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/react-components": "^0.82.2-3"
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
"maintainers": [],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/app-explorer": "^0.82.2-3",
|
||||
"@polkadot/react-components": "^0.82.2-3",
|
||||
"@polkadot/react-query": "^0.82.2-3"
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
"contributors": [],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/react-components": "^0.82.2-3",
|
||||
"@polkadot/react-params": "^0.82.2-3"
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/react-components": "^0.82.2-3"
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
"maintainers": [],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/react-components": "^0.82.2-3",
|
||||
"@polkadot/react-query": "^0.82.2-3"
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/react-components": "^0.82.2-3",
|
||||
"@polkadot/react-query": "^0.82.2-3"
|
||||
}
|
||||
|
||||
@ -14,10 +14,10 @@
|
||||
"bugs": "https://github.com/polkadot-js/apps/issues",
|
||||
"homepage": "https://github.com/polkadot-js/apps/tree/master/packages/react-api#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/api": "^3.11.2-3",
|
||||
"@polkadot/extension-dapp": "^0.37.2",
|
||||
"@polkadot/x-rxjs": "^5.9.3-0",
|
||||
"fflate": "^0.6.4"
|
||||
"fflate": "^0.6.7"
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
"contributors": [],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@fortawesome/fontawesome-svg-core": "^1.2.34",
|
||||
"@fortawesome/free-solid-svg-icons": "^5.15.2",
|
||||
"@fortawesome/react-fontawesome": "^0.1.14",
|
||||
@ -23,7 +23,7 @@
|
||||
"@polkadot/util-crypto": "^5.9.3-0",
|
||||
"chart.js": "^2.9.4",
|
||||
"codeflask": "^1.4.1",
|
||||
"i18next": "^19.9.0",
|
||||
"i18next": "^19.9.1",
|
||||
"i18next-browser-languagedetector": "^6.0.1",
|
||||
"owasp-password-strength-test": "^1.3.0",
|
||||
"react": "^17.0.1",
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { IdentityProps } from '@polkadot/react-identicon/types';
|
||||
import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces';
|
||||
|
||||
import React, { useCallback, useContext } from 'react';
|
||||
import styled from 'styled-components';
|
||||
@ -21,13 +22,17 @@ interface Props {
|
||||
prefix?: IdentityProps['prefix'];
|
||||
size?: number;
|
||||
theme?: IdentityProps['theme'] | 'robohash';
|
||||
value?: string | Uint8Array | null;
|
||||
value?: AccountId | AccountIndex | Address | string | Uint8Array | null;
|
||||
}
|
||||
|
||||
export function getIdentityTheme (systemName: string): 'substrate' {
|
||||
return ((settings.icon === 'default' && getSystemIcon(systemName)) || settings.icon) as 'substrate';
|
||||
}
|
||||
|
||||
function isCodec (value?: AccountId | AccountIndex | Address | string | Uint8Array | null): value is AccountId | AccountIndex | Address {
|
||||
return !!(value && (value as AccountId).toHuman);
|
||||
}
|
||||
|
||||
function IdentityIcon ({ className = '', prefix, size = 24, theme, value }: Props): React.ReactElement<Props> {
|
||||
const { isEthereum, systemName } = useApi();
|
||||
const { t } = useTranslation();
|
||||
@ -55,7 +60,7 @@ function IdentityIcon ({ className = '', prefix, size = 24, theme, value }: Prop
|
||||
prefix={prefix}
|
||||
size={size}
|
||||
theme={isEthereum ? 'ethereum' : thisTheme as 'substrate'}
|
||||
value={value}
|
||||
value={isCodec(value) ? value.toString() : value}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@ -11,6 +11,6 @@
|
||||
"bugs": "https://github.com/polkadot-js/apps/issues",
|
||||
"homepage": "https://github.com/polkadot-js/apps/tree/master/packages/react-hooks#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8"
|
||||
"@babel/runtime": "^7.13.9"
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
"contributors": [],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/react-components": "^0.82.2-3"
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,6 +11,6 @@
|
||||
"bugs": "https://github.com/polkadot-js/apps/issues",
|
||||
"homepage": "https://github.com/polkadot-js/apps/tree/master/packages/react-query#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8"
|
||||
"@babel/runtime": "^7.13.9"
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
"contributors": [],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"@polkadot/react-components": "^0.82.2-3"
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user