* Bump deps

* Massive numbers tweaks
This commit is contained in:
Jaco Greeff 2019-11-14 12:17:42 +01:00 committed by GitHub
parent 7236bf3219
commit cf67b1e9ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 65 additions and 58 deletions

View File

@ -10,10 +10,10 @@
"packages/*"
],
"resolutions": {
"@polkadot/api": "^0.97.0-beta.4",
"@polkadot/api-contract": "^0.97.0-beta.4",
"@polkadot/api": "^0.97.0-beta.5",
"@polkadot/api-contract": "^0.97.0-beta.5",
"@polkadot/keyring": "^1.7.0-beta.7",
"@polkadot/types": "^0.97.0-beta.4",
"@polkadot/types": "^0.97.0-beta.5",
"@polkadot/util": "^1.7.0-beta.7",
"@polkadot/util-crypto": "^1.7.0-beta.7",
"babel-core": "^7.0.0-bridge.0",

View File

@ -11,7 +11,7 @@
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.7.2",
"@polkadot/api-contract": "^0.97.0-beta.4",
"@polkadot/api-contract": "^0.97.0-beta.5",
"@polkadot/react-components": "^0.37.0-beta.80"
}
}

View File

@ -31,7 +31,7 @@
"homepage": "https://github.com/polkadot-js/ui/tree/master/packages/ui-reactive#readme",
"dependencies": {
"@babel/runtime": "^7.7.2",
"@polkadot/api": "^0.97.0-beta.4",
"@polkadot/api": "^0.97.0-beta.5",
"@polkadot/extension-dapp": "^0.14.0-beta.5",
"edgeware-node-types": "^1.0.10",
"rxjs-compat": "^6.5.3"

View File

@ -16,29 +16,36 @@ interface Props extends BareProps {
value?: Compact<any> | BN | string | null;
}
function format (value: Compact<any> | BN | string): string {
// for million, 2 * 3-grouping + comma
const M_LENGTH = 6 + 1;
function format (value: Compact<any> | BN | string, currency: string): string {
const [prefix, postfix] = formatBalance(value, { forceUnit: '-', withSi: false }).split('.');
return `${prefix}.${`000${postfix || ''}`.slice(-3)}`;
if (prefix.length > M_LENGTH) {
return formatBalance(value);
}
return `${prefix}.${`000${postfix || ''}`.slice(-3)} ${currency}`;
}
export function FormatBalance ({ children, className, label = '', value }: Props): React.ReactElement<Props> {
const [unit] = useState(formatBalance.getDefaults().unit);
const [currency] = useState(formatBalance.getDefaults().unit);
return (
<div className={className}>
{label}{
value
? format(value)
? format(value, currency)
: '-'
}&nbsp;{unit}{children}
}{children}
</div>
);
}
export default styled(FormatBalance)`
display: inline;
vertical-align: middle;
display: inline-block;
vertical-align: baseline;
* {
vertical-align: baseline;
@ -46,7 +53,7 @@ export default styled(FormatBalance)`
> label,
> .label {
display: inline;
display: inline-block;
margin-right: 0.25rem;
vertical-align: baseline;
}

View File

@ -2029,35 +2029,35 @@
dependencies:
"@types/node" ">= 8"
"@polkadot/api-contract@^0.97.0-beta.4":
version "0.97.0-beta.4"
resolved "https://registry.yarnpkg.com/@polkadot/api-contract/-/api-contract-0.97.0-beta.4.tgz#efeb75364ac117f9831f6a7c22330b261d31522c"
integrity sha512-edHfkRMP8Hzev8mIcJ56AIL6FbrQD4+cb7WM8xRH66TADgsbiTKYiQIxfC/dBxKyIdhPWX7vHtaGQCnAchIyuw==
"@polkadot/api-contract@^0.97.0-beta.5":
version "0.97.0-beta.5"
resolved "https://registry.yarnpkg.com/@polkadot/api-contract/-/api-contract-0.97.0-beta.5.tgz#739caa1fcccbb8a9715d988d8c5d51a459711445"
integrity sha512-eqPub7O66uNP4XNaE29LYpPrR4k4UG0mVIkKCY9db4qni8lUqT+Atr2COL0+kkc3IXtgzThvDDGkerBPvrqniQ==
dependencies:
"@babel/runtime" "^7.7.2"
"@polkadot/types" "^0.97.0-beta.4"
"@polkadot/types" "^0.97.0-beta.5"
"@polkadot/api-derive@^0.97.0-beta.4":
version "0.97.0-beta.4"
resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-0.97.0-beta.4.tgz#8d60f85151747282efeef3bc193f7d37d29a8d3b"
integrity sha512-PYk/7osGANTp0vicEzkXDZxWCEEy00wN4v8kyF4Tc7Z0lPYMKfkCdrzhG+NUFC0mswTHH5A4YI494VahTeawfQ==
"@polkadot/api-derive@^0.97.0-beta.5":
version "0.97.0-beta.5"
resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-0.97.0-beta.5.tgz#040f05412ac11395513bef3159781f6b49e0e8da"
integrity sha512-jWVQxQztgw9buYwTNlftkfk/MtEU+8RNcWQclR4uRnUnyuvLOAK80Slzualmmocrae6/1277xXWrdFfBZXG/tw==
dependencies:
"@babel/runtime" "^7.7.2"
"@polkadot/api" "^0.97.0-beta.4"
"@polkadot/types" "^0.97.0-beta.4"
"@polkadot/api" "^0.97.0-beta.5"
"@polkadot/types" "^0.97.0-beta.5"
"@polkadot/api@^0.97.0-beta.4":
version "0.97.0-beta.4"
resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-0.97.0-beta.4.tgz#5393fc2bc29ba751d97009f7ececbeac2c037a5f"
integrity sha512-wJ9tAxH+9eEHUfU6JusQjHoGqwKR0WD0qwUvuIvHclWOwjLLWBXLcXugVm2Y4hnJOqj30rIRJkU8IFSCSQY6BQ==
"@polkadot/api@^0.97.0-beta.5":
version "0.97.0-beta.5"
resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-0.97.0-beta.5.tgz#5e731252a7f8fc5aff8a7a1e283389f5a44141bb"
integrity sha512-g802gsX0CflqygBzy6PoUbjOaC4K//RmrZljt7MbBymzbxHgjtRLA3NF8eu38uDIYgoajf55+x0CimOYGpsXpA==
dependencies:
"@babel/runtime" "^7.7.2"
"@polkadot/api-derive" "^0.97.0-beta.4"
"@polkadot/api-derive" "^0.97.0-beta.5"
"@polkadot/keyring" "^1.7.0-beta.7"
"@polkadot/metadata" "^0.97.0-beta.4"
"@polkadot/rpc-core" "^0.97.0-beta.4"
"@polkadot/rpc-provider" "^0.97.0-beta.4"
"@polkadot/types" "^0.97.0-beta.4"
"@polkadot/metadata" "^0.97.0-beta.5"
"@polkadot/rpc-core" "^0.97.0-beta.5"
"@polkadot/rpc-provider" "^0.97.0-beta.5"
"@polkadot/types" "^0.97.0-beta.5"
"@polkadot/util-crypto" "^1.7.0-beta.7"
"@polkadot/dev-react@^0.32.0-beta.14":
@ -2160,10 +2160,10 @@
dependencies:
"@babel/runtime" "^7.7.2"
"@polkadot/jsonrpc@^0.97.0-beta.4":
version "0.97.0-beta.4"
resolved "https://registry.yarnpkg.com/@polkadot/jsonrpc/-/jsonrpc-0.97.0-beta.4.tgz#9936d7cf9af840afc6f6e6634c6c3022d5054122"
integrity sha512-EH6yieyDjiRejUha53R8qE+xQ0vmmFKW74gLYRgSb8Qe/BrCGIk9TkdZFk3tJM6dPsgFHL1bXNz3IRuhZFPrvg==
"@polkadot/jsonrpc@^0.97.0-beta.5":
version "0.97.0-beta.5"
resolved "https://registry.yarnpkg.com/@polkadot/jsonrpc/-/jsonrpc-0.97.0-beta.5.tgz#5ca57a181880732d09c4a1dead8029c99825b79a"
integrity sha512-r99Kc3u4D5SAQ7Uc8gC8QEq/ofcQAozD4ISfzfWSPRSmFUE+UkxCqUrTLq+bfeEOLc9LkG3wIMWJ+3QlcY5hyw==
dependencies:
"@babel/runtime" "^7.7.2"
@ -2176,13 +2176,13 @@
"@polkadot/util" "^1.7.0-beta.7"
"@polkadot/util-crypto" "^1.7.0-beta.7"
"@polkadot/metadata@^0.97.0-beta.4":
version "0.97.0-beta.4"
resolved "https://registry.yarnpkg.com/@polkadot/metadata/-/metadata-0.97.0-beta.4.tgz#d05d10f308237e46916d4903339eab34feb5d1a1"
integrity sha512-UFGo0NNkD02jButVbPu+l8BMVilnVHlc4KBR+unn6e5LLGCBPhXomGBe4skwZT/S6pPgJV53p6CZZZmCKKwrDw==
"@polkadot/metadata@^0.97.0-beta.5":
version "0.97.0-beta.5"
resolved "https://registry.yarnpkg.com/@polkadot/metadata/-/metadata-0.97.0-beta.5.tgz#7c16a5bd134a8de644f8a8c2b83b2701bdfc7c8a"
integrity sha512-IVyKFJX7WH+mfOrOetwV5FP5JweHdn4df2Gmmh+7pTGbo2IYSUnTwwKzjPdGFtLWg7oCBFwtRGYK/4CucsUL2w==
dependencies:
"@babel/runtime" "^7.7.2"
"@polkadot/types" "^0.97.0-beta.4"
"@polkadot/types" "^0.97.0-beta.5"
"@polkadot/util" "^1.7.0-beta.7"
"@polkadot/util-crypto" "^1.7.0-beta.7"
@ -2211,25 +2211,25 @@
qrcode-generator "^1.4.4"
react-qr-reader "^2.2.1"
"@polkadot/rpc-core@^0.97.0-beta.4":
version "0.97.0-beta.4"
resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-0.97.0-beta.4.tgz#5f189166e8d41419f163943874fdc921b50e1cec"
integrity sha512-f2tViM7br0CNwuwaIJR9GwGgKif9RzoA6PljRYBZr96EGZhCzybZVIaKFO2V1SNz23gvMSrqQ/Muno2ryYLP0w==
"@polkadot/rpc-core@^0.97.0-beta.5":
version "0.97.0-beta.5"
resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-0.97.0-beta.5.tgz#53643d8ce11b2a3b28ed1e4f0afdb73b1e853321"
integrity sha512-VhiDsvaVnLUgUwLI5eibVGxbe7fj00s4fW4dEjeUnWEzfX5gja18P4gkqjskvjLNkkHQ5TljKwAXmVS9X8IvQQ==
dependencies:
"@babel/runtime" "^7.7.2"
"@polkadot/jsonrpc" "^0.97.0-beta.4"
"@polkadot/rpc-provider" "^0.97.0-beta.4"
"@polkadot/types" "^0.97.0-beta.4"
"@polkadot/jsonrpc" "^0.97.0-beta.5"
"@polkadot/rpc-provider" "^0.97.0-beta.5"
"@polkadot/types" "^0.97.0-beta.5"
"@polkadot/util" "^1.7.0-beta.7"
rxjs "^6.5.3"
"@polkadot/rpc-provider@^0.97.0-beta.4":
version "0.97.0-beta.4"
resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-0.97.0-beta.4.tgz#8b36aa6595c12998fa3fe5c3a3cb991bdf52c1af"
integrity sha512-1iDHw4NLpIOB13vjACys/yLpg3qEKWGcmYaWVOTbhLimX4BrCq/nu+cOB+x4ZmbbwHuGorXsXkEvottnXtP/NQ==
"@polkadot/rpc-provider@^0.97.0-beta.5":
version "0.97.0-beta.5"
resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-0.97.0-beta.5.tgz#c616d2bf56c00c6718f2c5879997aa5c7cc16a2b"
integrity sha512-b814LzO51VFhysX6NoGZq6w4MBqKzHSJk6ZBZrTdHJN1USquK5GtR72wPtYD3gzpb10sYFiFQpsk29hO3be26w==
dependencies:
"@babel/runtime" "^7.7.2"
"@polkadot/metadata" "^0.97.0-beta.4"
"@polkadot/metadata" "^0.97.0-beta.5"
"@polkadot/util" "^1.7.0-beta.7"
"@polkadot/util-crypto" "^1.7.0-beta.7"
eventemitter3 "^4.0.0"
@ -2243,10 +2243,10 @@
dependencies:
"@types/chrome" "^0.0.91"
"@polkadot/types@^0.97.0-beta.4":
version "0.97.0-beta.4"
resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-0.97.0-beta.4.tgz#28dcd15101a12e3f41ef0a343985bb59005623a9"
integrity sha512-E/5uT5zcr4sE+Wzl57drfBFxibDRWyxCwolK+e/Dwo3Dutoa/At9/j+/qgwaJHLtDlzzJyv1vpB9PB+u0r4hrw==
"@polkadot/types@^0.97.0-beta.5":
version "0.97.0-beta.5"
resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-0.97.0-beta.5.tgz#4596ca133c79ec32912ba5d29055a9812e849b5b"
integrity sha512-tTYOVhEd5FLOXFb8mYij1LRzTMaiU66v1sQWBfuvfg4MTWOf6cJ+f4SSm4gLuTQPiY6G9cxzeKPFWEs0Xk8OeA==
dependencies:
"@babel/runtime" "^7.7.2"
"@polkadot/util" "^1.7.0-beta.7"