Skip to content

Commit

Permalink
API 1.0-beta & common 2.0-beta (polkadot-js#2115)
Browse files Browse the repository at this point in the history
* API 1.0-beta & common 2.0-beta

* May fix effect issue
  • Loading branch information
jacogr authored and jordy25519 committed Feb 20, 2020
1 parent faec2e7 commit b5701da
Show file tree
Hide file tree
Showing 9 changed files with 134 additions and 139 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
"packages/*"
],
"resolutions": {
"@polkadot/api": "^0.100.1",
"@polkadot/api-contract": "^0.100.1",
"@polkadot/keyring": "^1.8.1",
"@polkadot/types": "^0.100.1",
"@polkadot/util": "^1.8.1",
"@polkadot/util-crypto": "^1.8.1",
"@polkadot/api": "^1.0.0-beta.3",
"@polkadot/api-contract": "^1.0.0-beta.3",
"@polkadot/keyring": "^2.0.0-beta.1",
"@polkadot/types": "^1.0.0-beta.3",
"@polkadot/util": "^2.0.0-beta.1",
"@polkadot/util-crypto": "^2.0.0-beta.1",
"babel-core": "^7.0.0-bridge.0",
"typescript": "^3.7.4"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/app-accounts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"@babel/runtime": "^7.7.7",
"@polkadot/react-components": "^0.39.0-beta.47",
"@polkadot/react-qr": "^0.48.0-beta.9",
"@polkadot/react-qr": "^0.48.0-beta.10",
"@types/file-saver": "^2.0.0",
"@types/yargs": "^13.0.2",
"detect-browser": "^4.8.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/app-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.7.7",
"@polkadot/api-contract": "^0.100.1"
"@polkadot/api-contract": "^1.0.0-beta.3"
}
}
2 changes: 1 addition & 1 deletion packages/apps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@babel/runtime": "^7.7.7",
"@polkadot/react-components": "^0.39.0-beta.47",
"@polkadot/react-signer": "^0.39.0-beta.47",
"@polkadot/ui-assets": "^0.48.0-beta.9",
"@polkadot/ui-assets": "^0.48.0-beta.10",
"query-string": "^6.8.3"
}
}
4 changes: 2 additions & 2 deletions packages/react-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"homepage": "https://github.com/polkadot-js/ui/tree/master/packages/ui-reactive#readme",
"dependencies": {
"@babel/runtime": "^7.7.6",
"@polkadot/api": "^0.100.1",
"@polkadot/extension-dapp": "^0.15.0-beta.0",
"@polkadot/api": "^1.0.0-beta.3",
"@polkadot/extension-dapp": "^0.15.0-beta.1",
"edgeware-node-types": "^1.0.10",
"rxjs-compat": "^6.5.3"
}
Expand Down
8 changes: 4 additions & 4 deletions packages/react-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.7.6",
"@polkadot/keyring": "^1.8.1",
"@polkadot/keyring": "^2.0.0-beta.1",
"@polkadot/react-api": "^0.39.0-beta.47",
"@polkadot/react-identicon": "^0.48.0-beta.9",
"@polkadot/react-identicon": "^0.48.0-beta.10",
"@polkadot/react-query": "^0.39.0-beta.47",
"@polkadot/ui-keyring": "^0.48.0-beta.9",
"@polkadot/ui-settings": "^0.48.0-beta.9",
"@polkadot/ui-keyring": "^0.48.0-beta.10",
"@polkadot/ui-settings": "^0.48.0-beta.10",
"@types/chart.js": "^2.9.8",
"@types/i18next": "^13.0.0",
"@types/react-copy-to-clipboard": "^4.3.0",
Expand Down
21 changes: 8 additions & 13 deletions packages/react-components/src/AddressInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ function calcBonded (stakingInfo?: DerivedStakingAccount, bonded?: boolean | BN[
return [own, other];
}

function renderExtended ({ balancesAll, address, withExtended }: Props): React.ReactNode {
const { t } = useTranslation();
function renderExtended ({ balancesAll, address, withExtended }: Props, t: (key: string) => string): React.ReactNode {
const extendedDisplay = withExtended === true
? DEFAULT_EXTENDED
: withExtended || undefined;
Expand Down Expand Up @@ -160,9 +159,7 @@ function renderExtended ({ balancesAll, address, withExtended }: Props): React.R
);
}

function renderUnlocking ({ stakingInfo }: Props): React.ReactNode {
const { t } = useTranslation();

function renderUnlocking ({ stakingInfo }: Props, t: (key: string, data: any) => string): React.ReactNode {
if (!stakingInfo || !stakingInfo.unlocking || !stakingInfo.unlocking.length) {
return null;
}
Expand Down Expand Up @@ -198,8 +195,7 @@ function renderUnlocking ({ stakingInfo }: Props): React.ReactNode {
);
}

function renderValidatorPrefs ({ stakingInfo, withValidatorPrefs = false }: Props): React.ReactNode {
const { t } = useTranslation();
function renderValidatorPrefs ({ stakingInfo, withValidatorPrefs = false }: Props, t: (key: string) => string): React.ReactNode {
const validatorPrefsDisplay = withValidatorPrefs === true
? DEFAULT_PREFS
: withValidatorPrefs;
Expand Down Expand Up @@ -241,8 +237,7 @@ function renderValidatorPrefs ({ stakingInfo, withValidatorPrefs = false }: Prop
);
}

function renderBalances (props: Props, allAccounts: string[]): React.ReactNode {
const { t } = useTranslation();
function renderBalances (props: Props, allAccounts: string[], t: (key: string) => string): React.ReactNode {
const { balancesAll, stakingInfo, withBalance = true, withBalanceToggle = false } = props;
const balanceDisplay = withBalance === true
? DEFAULT_BALANCES
Expand Down Expand Up @@ -344,7 +339,7 @@ function renderBalances (props: Props, allAccounts: string[]): React.ReactNode {
<>
<Label label={t('unbonding')} />
<div className='result'>
{renderUnlocking(props)}
{renderUnlocking(props, t)}
</div>
</>
)}
Expand Down Expand Up @@ -384,7 +379,7 @@ function AddressInfo (props: Props): React.ReactElement<Props> {
return (
<div className={`ui--AddressInfo ${className} ${withBalanceToggle ? 'ui--AddressInfo-expander' : ''}`}>
<div className={`column ${withBalanceToggle ? 'column--expander' : ''}`}>
{renderBalances(props, allAccounts)}
{renderBalances(props, allAccounts, t)}
{withHexSessionId && withHexSessionId[0] && (
<>
<Label label={t('session keys')} />
Expand All @@ -397,7 +392,7 @@ function AddressInfo (props: Props): React.ReactElement<Props> {
<div className='result'>{withHexSessionId[1]}</div>
</>
)}
{renderValidatorPrefs(props)}
{renderValidatorPrefs(props, t)}
{extraInfo && (
<>
<div />
Expand All @@ -418,7 +413,7 @@ function AddressInfo (props: Props): React.ReactElement<Props> {
</>
)}
</div>
{renderExtended(props)}
{renderExtended(props, t)}
{children && (
<div className='column'>
{children}
Expand Down
2 changes: 1 addition & 1 deletion packages/react-signer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"dependencies": {
"@babel/runtime": "^7.7.7",
"@polkadot/react-components": "^0.39.0-beta.47",
"@polkadot/react-qr": "^0.48.0-beta.9"
"@polkadot/react-qr": "^0.48.0-beta.10"
}
}
Loading

0 comments on commit b5701da

Please sign in to comment.