Display sub identities (#2107)
This commit is contained in:
parent
762c4dcb23
commit
e8dd9ab706
@ -10,10 +10,10 @@
|
||||
"packages/*"
|
||||
],
|
||||
"resolutions": {
|
||||
"@polkadot/api": "^0.100.0-beta.27",
|
||||
"@polkadot/api-contract": "^0.100.0-beta.27",
|
||||
"@polkadot/api": "^0.100.0-beta.28",
|
||||
"@polkadot/api-contract": "^0.100.0-beta.28",
|
||||
"@polkadot/keyring": "^1.8.1",
|
||||
"@polkadot/types": "^0.100.0-beta.27",
|
||||
"@polkadot/types": "^0.100.0-beta.28",
|
||||
"@polkadot/util": "^1.8.1",
|
||||
"@polkadot/util-crypto": "^1.8.1",
|
||||
"babel-core": "^7.0.0-bridge.0",
|
||||
|
||||
@ -63,6 +63,7 @@ function Identity ({ address, className, onClose }: Props): React.ReactElement<P
|
||||
const [hasLegal, setHasLegal] = useState(false);
|
||||
// const [hasPgp, setHasPgp] = useState(false);
|
||||
const [hasRiot, setHasRiot] = useState(false);
|
||||
const [hasTwitter, setHasTwitter] = useState(false);
|
||||
const [hasWeb, setHasWeb] = useState(false);
|
||||
const [valDisplay, setValDisplay] = useState(getAddressMeta(address).name || '');
|
||||
const [valEmail, setValEmail] = useState('');
|
||||
@ -70,6 +71,7 @@ function Identity ({ address, className, onClose }: Props): React.ReactElement<P
|
||||
const [valLegal, setValLegal] = useState('');
|
||||
// const [{ errPgp, valPgp }, setValPgp] = useState<{ errPgp: boolean; valPgp: string }>({ errPgp: true, valPgp: '' });
|
||||
const [valRiot, setValRiot] = useState('');
|
||||
const [valTwitter, setValTwitter] = useState('');
|
||||
const [valWeb, setValWeb] = useState('');
|
||||
|
||||
useEffect((): void => {
|
||||
@ -80,6 +82,7 @@ function Identity ({ address, className, onClose }: Props): React.ReactElement<P
|
||||
setData(info.email, setHasEmail, setValEmail);
|
||||
setData(info.legal, setHasLegal, setValLegal);
|
||||
setData(info.riot, setHasRiot, setValRiot);
|
||||
setData(info.twitter, setHasTwitter, setValTwitter);
|
||||
setData(info.web, setHasWeb, setValWeb);
|
||||
}
|
||||
}, [identityOpt]);
|
||||
@ -90,6 +93,7 @@ function Identity ({ address, className, onClose }: Props): React.ReactElement<P
|
||||
email: { [hasEmail ? 'raw' : 'none']: hasEmail ? valEmail : null },
|
||||
legal: { [hasLegal ? 'raw' : 'none']: hasLegal ? valLegal : null },
|
||||
riot: { [hasRiot ? 'raw' : 'none']: hasRiot ? valRiot : null },
|
||||
twitter: { [hasTwitter ? 'raw' : 'none']: hasTwitter ? valTwitter : null },
|
||||
web: { [hasWeb ? 'raw' : 'none']: hasWeb ? valWeb : null }
|
||||
// image: { [hasImg ? 'sha256' : 'none']: hasImg ? valImg : null },
|
||||
// pgpFingerprint: hasPgp ? valPgp : null
|
||||
@ -151,6 +155,18 @@ function Identity ({ address, className, onClose }: Props): React.ReactElement<P
|
||||
value={hasWeb ? valWeb : '<none>'}
|
||||
/>
|
||||
</WrapToggle>
|
||||
<WrapToggle
|
||||
onChange={setHasTwitter}
|
||||
value={hasTwitter}
|
||||
>
|
||||
<Input
|
||||
help={t('The twitter name for this identity.')}
|
||||
isDisabled={!hasTwitter}
|
||||
label={t('twitter')}
|
||||
onChange={setValTwitter}
|
||||
value={hasTwitter ? valTwitter : '<none>'}
|
||||
/>
|
||||
</WrapToggle>
|
||||
<WrapToggle
|
||||
onChange={setHasRiot}
|
||||
value={hasRiot}
|
||||
|
||||
@ -11,6 +11,6 @@
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.7.7",
|
||||
"@polkadot/api-contract": "^0.100.0-beta.27"
|
||||
"@polkadot/api-contract": "^0.100.0-beta.28"
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
"homepage": "https://github.com/polkadot-js/ui/tree/master/packages/ui-reactive#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.7.6",
|
||||
"@polkadot/api": "^0.100.0-beta.27",
|
||||
"@polkadot/api": "^0.100.0-beta.28",
|
||||
"@polkadot/extension-dapp": "^0.15.0-beta.0",
|
||||
"edgeware-node-types": "^1.0.10",
|
||||
"rxjs-compat": "^6.5.3"
|
||||
|
||||
@ -13,6 +13,7 @@ import { Option } from '@polkadot/types';
|
||||
|
||||
import { useTranslation } from './translate';
|
||||
import { getAddressName } from './util';
|
||||
import AddressMini from './AddressMini';
|
||||
import Badge from './Badge';
|
||||
import Button from './Button';
|
||||
import Dropdown from './Dropdown';
|
||||
@ -135,6 +136,12 @@ function AccountName ({ children, className, defaultName, label, onClick, overri
|
||||
<td>{t('display')}</td>
|
||||
<td>{identity.display}</td>
|
||||
</tr>
|
||||
{identity.parent && (
|
||||
<tr>
|
||||
<td>{t('parent')}</td>
|
||||
<td><AddressMini value={identity.parent} /></td>
|
||||
</tr>
|
||||
)}
|
||||
{identity.legal && (
|
||||
<tr>
|
||||
<td>{t('legal')}</td>
|
||||
@ -153,6 +160,12 @@ function AccountName ({ children, className, defaultName, label, onClick, overri
|
||||
<td>{identity.web}</td>
|
||||
</tr>
|
||||
)}
|
||||
{identity.twitter && (
|
||||
<tr>
|
||||
<td>{t('twitter')}</td>
|
||||
<td>{identity.twitter}</td>
|
||||
</tr>
|
||||
)}
|
||||
{identity.riot && (
|
||||
<tr>
|
||||
<td>{t('riot')}</td>
|
||||
@ -172,7 +185,7 @@ function AccountName ({ children, className, defaultName, label, onClick, overri
|
||||
<div className='via-identity'>
|
||||
<Badge
|
||||
hover={hover}
|
||||
info={<Icon name={isGood ? 'check' : 'minus'} />}
|
||||
info={<Icon name={identity.parent ? 'caret square up outline' : (isGood ? 'check' : 'minus')} />}
|
||||
isInline
|
||||
isSmall
|
||||
isTooltip
|
||||
|
||||
Loading…
Reference in New Issue
Block a user