Voting delegations (#2619)
* Add vote delegations * Add handling for democracy delegations * Bump API * Remove wrong prop
This commit is contained in:
parent
b73e5d1fae
commit
865ac836c4
@ -8,10 +8,10 @@
|
||||
"packages/*"
|
||||
],
|
||||
"resolutions": {
|
||||
"@polkadot/api": "^1.12.0-beta.3",
|
||||
"@polkadot/api-contract": "^1.12.0-beta.3",
|
||||
"@polkadot/api": "^1.12.0-beta.4",
|
||||
"@polkadot/api-contract": "^1.12.0-beta.4",
|
||||
"@polkadot/keyring": "^2.8.1",
|
||||
"@polkadot/types": "^1.12.0-beta.3",
|
||||
"@polkadot/types": "^1.12.0-beta.4",
|
||||
"@polkadot/util": "^2.8.1",
|
||||
"@polkadot/util-crypto": "^2.8.1",
|
||||
"babel-core": "^7.0.0-bridge.0",
|
||||
|
||||
@ -12,6 +12,6 @@
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.9.2",
|
||||
"@polkadot/api-contract": "^1.12.0-beta.3"
|
||||
"@polkadot/api-contract": "^1.12.0-beta.4"
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,15 +14,15 @@ interface Props {
|
||||
|
||||
const sizing = ['0.1x', '1x', '2x', '3x', '4x', '5x', '6x'];
|
||||
|
||||
function voteLabel (vote: Vote): string {
|
||||
return `${sizing[vote.conviction.toNumber()]} - `;
|
||||
function voteLabel ({ conviction }: Vote, isDelegating: boolean): string {
|
||||
return `${sizing[conviction.toNumber()]}${isDelegating ? '/d' : ''} - `;
|
||||
}
|
||||
|
||||
function ReferendumVote ({ vote: { accountId, balance, vote } }: Props): React.ReactElement<Props> {
|
||||
function ReferendumVote ({ vote: { accountId, balance, isDelegating, vote } }: Props): React.ReactElement<Props> {
|
||||
return (
|
||||
<AddressMini
|
||||
balance={balance}
|
||||
labelBalance={voteLabel(vote)}
|
||||
labelBalance={voteLabel(vote, isDelegating)}
|
||||
value={accountId}
|
||||
withBalance
|
||||
/>
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
"homepage": "https://github.com/polkadot-js/ui/tree/master/packages/ui-reactive#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.9.2",
|
||||
"@polkadot/api": "^1.12.0-beta.3",
|
||||
"@polkadot/api": "^1.12.0-beta.4",
|
||||
"@polkadot/extension-dapp": "^0.25.0-beta.1",
|
||||
"rxjs-compat": "^6.5.5"
|
||||
}
|
||||
|
||||
112
yarn.lock
112
yarn.lock
@ -2837,57 +2837,57 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/api-contract@npm:^1.12.0-beta.3":
|
||||
version: 1.12.0-beta.3
|
||||
resolution: "@polkadot/api-contract@npm:1.12.0-beta.3"
|
||||
"@polkadot/api-contract@npm:^1.12.0-beta.4":
|
||||
version: 1.12.0-beta.4
|
||||
resolution: "@polkadot/api-contract@npm:1.12.0-beta.4"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.9.2
|
||||
"@polkadot/api": 1.12.0-beta.3
|
||||
"@polkadot/rpc-core": 1.12.0-beta.3
|
||||
"@polkadot/types": 1.12.0-beta.3
|
||||
"@polkadot/api": 1.12.0-beta.4
|
||||
"@polkadot/rpc-core": 1.12.0-beta.4
|
||||
"@polkadot/types": 1.12.0-beta.4
|
||||
"@polkadot/util": ^2.8.1
|
||||
bn.js: ^5.1.1
|
||||
rxjs: ^6.5.5
|
||||
checksum: 2/98abf72f317e817f0798944cfb03fb48fd56bf50856aebd94a9e0dfc1f2cdf49b6a6e702876e7d309b3edc19bbb06848d87a76da93ae0fb1f18bfcac3b5fddb4
|
||||
checksum: 2/ae95d2463beb91a2cf66bfd608dcf0d5d954d48589bc55ec7e09703e8d606261e4a3a25401fdd572abdf4f5c9e3f9c7c97e398ecdc454d14ec1139bf9ef321e3
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/api-derive@npm:1.12.0-beta.3":
|
||||
version: 1.12.0-beta.3
|
||||
resolution: "@polkadot/api-derive@npm:1.12.0-beta.3"
|
||||
"@polkadot/api-derive@npm:1.12.0-beta.4":
|
||||
version: 1.12.0-beta.4
|
||||
resolution: "@polkadot/api-derive@npm:1.12.0-beta.4"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.9.2
|
||||
"@polkadot/api": 1.12.0-beta.3
|
||||
"@polkadot/rpc-core": 1.12.0-beta.3
|
||||
"@polkadot/rpc-provider": 1.12.0-beta.3
|
||||
"@polkadot/types": 1.12.0-beta.3
|
||||
"@polkadot/api": 1.12.0-beta.4
|
||||
"@polkadot/rpc-core": 1.12.0-beta.4
|
||||
"@polkadot/rpc-provider": 1.12.0-beta.4
|
||||
"@polkadot/types": 1.12.0-beta.4
|
||||
"@polkadot/util": ^2.8.1
|
||||
"@polkadot/util-crypto": ^2.8.1
|
||||
bn.js: ^5.1.1
|
||||
memoizee: ^0.4.14
|
||||
rxjs: ^6.5.5
|
||||
checksum: 2/9a45275f52657c060b7b834f3a920a21889d70ce19220efcdc9aee685f5598c9f73e411c80a080e82942bf8dbbf86597a7b62a85745a31478fbebfc7ead67a62
|
||||
checksum: 2/9f015cc6d140612c26f58c1abf6ddbaafa5f923623dd019c504e24d471f11a32d4023f7bb77ad2bb6af6d264ee0f4ade41554152e1718d5f5d873635fbd9f634
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/api@npm:^1.12.0-beta.3":
|
||||
version: 1.12.0-beta.3
|
||||
resolution: "@polkadot/api@npm:1.12.0-beta.3"
|
||||
"@polkadot/api@npm:^1.12.0-beta.4":
|
||||
version: 1.12.0-beta.4
|
||||
resolution: "@polkadot/api@npm:1.12.0-beta.4"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.9.2
|
||||
"@polkadot/api-derive": 1.12.0-beta.3
|
||||
"@polkadot/api-derive": 1.12.0-beta.4
|
||||
"@polkadot/keyring": ^2.8.1
|
||||
"@polkadot/metadata": 1.12.0-beta.3
|
||||
"@polkadot/rpc-core": 1.12.0-beta.3
|
||||
"@polkadot/rpc-provider": 1.12.0-beta.3
|
||||
"@polkadot/types": 1.12.0-beta.3
|
||||
"@polkadot/types-known": 1.12.0-beta.3
|
||||
"@polkadot/metadata": 1.12.0-beta.4
|
||||
"@polkadot/rpc-core": 1.12.0-beta.4
|
||||
"@polkadot/rpc-provider": 1.12.0-beta.4
|
||||
"@polkadot/types": 1.12.0-beta.4
|
||||
"@polkadot/types-known": 1.12.0-beta.4
|
||||
"@polkadot/util": ^2.8.1
|
||||
"@polkadot/util-crypto": ^2.8.1
|
||||
bn.js: ^5.1.1
|
||||
eventemitter3: ^4.0.0
|
||||
rxjs: ^6.5.5
|
||||
checksum: 2/87cd3e0e762a0dda127f1399f91e01f6717e6fc878a9b6931e1f284b6e70bbbf8b8bd1ae3e3352624222c272970b7e7f6080d2c7f3cd17db361a16ebd4efdc3f
|
||||
checksum: 2/d12fc872f2450fb378b9633474ca02c819ec3183d2e05cd4284ce621021002abbc300a1096751b9c258965ffbc6e1c23e238f475b7fc00637249a4b3e2e1e9e9
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -2928,7 +2928,7 @@ __metadata:
|
||||
resolution: "@polkadot/app-contracts@workspace:packages/page-contracts"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.9.2
|
||||
"@polkadot/api-contract": ^1.12.0-beta.3
|
||||
"@polkadot/api-contract": ^1.12.0-beta.4
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
@ -3254,17 +3254,17 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/metadata@npm:1.12.0-beta.3":
|
||||
version: 1.12.0-beta.3
|
||||
resolution: "@polkadot/metadata@npm:1.12.0-beta.3"
|
||||
"@polkadot/metadata@npm:1.12.0-beta.4":
|
||||
version: 1.12.0-beta.4
|
||||
resolution: "@polkadot/metadata@npm:1.12.0-beta.4"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.9.2
|
||||
"@polkadot/types": 1.12.0-beta.3
|
||||
"@polkadot/types-known": 1.12.0-beta.3
|
||||
"@polkadot/types": 1.12.0-beta.4
|
||||
"@polkadot/types-known": 1.12.0-beta.4
|
||||
"@polkadot/util": ^2.8.1
|
||||
"@polkadot/util-crypto": ^2.8.1
|
||||
bn.js: ^5.1.1
|
||||
checksum: 2/f0f0c0e772f8d9204d9b79fd0c3fbb53301e457c59ce193131d3352949dc886248ebe704bd2c461ee2f872bd0d00a13de214d0aaa89eacd1e5e83eb42a2b26f1
|
||||
checksum: 2/6be58e793ad023a544296d37d4032d77f5702c9d0ee71e15d1cecdbc3b8b07c74bb41ddcfee62f873132378026c618984874c7b58c7f6e341b40297dc3efc804
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -3273,7 +3273,7 @@ __metadata:
|
||||
resolution: "@polkadot/react-api@workspace:packages/react-api"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.9.2
|
||||
"@polkadot/api": ^1.12.0-beta.3
|
||||
"@polkadot/api": ^1.12.0-beta.4
|
||||
"@polkadot/extension-dapp": ^0.25.0-beta.1
|
||||
rxjs-compat: ^6.5.5
|
||||
languageName: unknown
|
||||
@ -3390,35 +3390,35 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/rpc-core@npm:1.12.0-beta.3":
|
||||
version: 1.12.0-beta.3
|
||||
resolution: "@polkadot/rpc-core@npm:1.12.0-beta.3"
|
||||
"@polkadot/rpc-core@npm:1.12.0-beta.4":
|
||||
version: 1.12.0-beta.4
|
||||
resolution: "@polkadot/rpc-core@npm:1.12.0-beta.4"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.9.2
|
||||
"@polkadot/metadata": 1.12.0-beta.3
|
||||
"@polkadot/rpc-provider": 1.12.0-beta.3
|
||||
"@polkadot/types": 1.12.0-beta.3
|
||||
"@polkadot/metadata": 1.12.0-beta.4
|
||||
"@polkadot/rpc-provider": 1.12.0-beta.4
|
||||
"@polkadot/types": 1.12.0-beta.4
|
||||
"@polkadot/util": ^2.8.1
|
||||
memoizee: ^0.4.14
|
||||
rxjs: ^6.5.5
|
||||
checksum: 2/6c1bbc68f7f467522e9b7ecb8d530e3a87960bd58fedb7dc27d9c7a494fdc10dbab64d9914730f70c0685de9defe94f6be1cc01735c767d230b493b044b56e2c
|
||||
checksum: 2/88c651a96e1908b6043cfc919144dc7ae1633b2b51a5536f9339135dec3d62c8c4adf58a69ee7dafbe6e6c5cda9489ea0f8b296751c984a201dfcc631972b3ed
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/rpc-provider@npm:1.12.0-beta.3":
|
||||
version: 1.12.0-beta.3
|
||||
resolution: "@polkadot/rpc-provider@npm:1.12.0-beta.3"
|
||||
"@polkadot/rpc-provider@npm:1.12.0-beta.4":
|
||||
version: 1.12.0-beta.4
|
||||
resolution: "@polkadot/rpc-provider@npm:1.12.0-beta.4"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.9.2
|
||||
"@polkadot/metadata": 1.12.0-beta.3
|
||||
"@polkadot/types": 1.12.0-beta.3
|
||||
"@polkadot/metadata": 1.12.0-beta.4
|
||||
"@polkadot/types": 1.12.0-beta.4
|
||||
"@polkadot/util": ^2.8.1
|
||||
"@polkadot/util-crypto": ^2.8.1
|
||||
bn.js: ^5.1.1
|
||||
eventemitter3: ^4.0.0
|
||||
isomorphic-fetch: ^2.2.1
|
||||
websocket: ^1.0.31
|
||||
checksum: 2/5a619a65ca027ca4d5f333dd8af7d0e2016689c5e60f0adaa06ac8a8b2e244687c517e37808c20a50934ad883f52e0a936ed06c345d4e106c971a36f871e7c09
|
||||
checksum: 2/20a4d8206ba27973911d5072bc45b496df476d538324cda2884d06e16e84c8b6f837427f1896138bde4f9e64cecda75a70a465b2fd7742236e7f43fae1c21863
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -3431,31 +3431,31 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/types-known@npm:1.12.0-beta.3":
|
||||
version: 1.12.0-beta.3
|
||||
resolution: "@polkadot/types-known@npm:1.12.0-beta.3"
|
||||
"@polkadot/types-known@npm:1.12.0-beta.4":
|
||||
version: 1.12.0-beta.4
|
||||
resolution: "@polkadot/types-known@npm:1.12.0-beta.4"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.9.2
|
||||
"@polkadot/types": 1.12.0-beta.3
|
||||
"@polkadot/types": 1.12.0-beta.4
|
||||
"@polkadot/util": ^2.8.1
|
||||
bn.js: ^5.1.1
|
||||
checksum: 2/8dd9f0235cddc8096c1d3f86e47d784c30dfc266705fb40590c812613cd0e2cf10a1320a7443d6f55d5384c020b1cbb87aef824d0a883cf4027ad35b054b6e37
|
||||
checksum: 2/51c1a94c72fa31aade4652c5740108b9d3307d3273f8cd527b21fc956dc86ee4b5a2e2ef8714b2170b1e63b89d5b9ba7ccf7d8c39fa234f4c76f6b352c0dce47
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/types@npm:^1.12.0-beta.3":
|
||||
version: 1.12.0-beta.3
|
||||
resolution: "@polkadot/types@npm:1.12.0-beta.3"
|
||||
"@polkadot/types@npm:^1.12.0-beta.4":
|
||||
version: 1.12.0-beta.4
|
||||
resolution: "@polkadot/types@npm:1.12.0-beta.4"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.9.2
|
||||
"@polkadot/metadata": 1.12.0-beta.3
|
||||
"@polkadot/metadata": 1.12.0-beta.4
|
||||
"@polkadot/util": ^2.8.1
|
||||
"@polkadot/util-crypto": ^2.8.1
|
||||
"@types/bn.js": ^4.11.6
|
||||
bn.js: ^5.1.1
|
||||
memoizee: ^0.4.14
|
||||
rxjs: ^6.5.5
|
||||
checksum: 2/08724732aef059a7b98aacb60b6c3870dc447f6e387ce38fbd62cd7db7375d70cc6b84c0c960f3b3319b4ede65f45608661b70c7b6baff4b191ec9ce449aeb68
|
||||
checksum: 2/95070b1dfe89ad4944965db8bc890c1358c3a593f08c842e621b525d9ebba91032b2e9e1878e5fbad6a2c8ff641777811e3fb2f2399bbfa76ca89e991a7cde95
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user