Don't display unbonding blocks in Aura (#3896)

This commit is contained in:
Jaco Greeff 2020-10-19 12:02:31 +02:00 committed by GitHub
parent a72ee9f2d7
commit dc4db837a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 35 additions and 29 deletions

View File

@ -763,7 +763,7 @@
"Unbid": "إلغاء العرض",
"Unbond": "إلغاء الربط",
"Unbond funds": "إلغاء الربط الأموال",
"Unbonding {{value}}, ": "،{{إلغاء الربط {{قيمة",
"Unbonding {{value}}": "،{{إلغاء الربط {{قيمة",
"Uncaught error. Something went wrong with the query and rendering of this component. {{message}}": "{{خطأ غير مسلط. حدث خطأ ما في الاستعلام عن هذا المكون وتصويله. {{رسالة",
"Undelegate": "إلغاء التفويض",
"Unit": "وحدة",
@ -1300,4 +1300,4 @@
"{{threshold}}, not passing": "سقف}}، لا يتم تمريره}}",
"{{threshold}}, passing": "سقف}}، يتم تمريره}}",
"{{value}}x voting balance, locked for {{lock}}x enactment ({{period}} days)": "({{قفل}} (تاريخ إصدار {{أيام}}x رصيد التصويت، مقفل لـ x {{قيمة }}"
}
}

View File

@ -19,7 +19,7 @@
"This operation does not remove the history of the account from the chain, nor any associated funds from the account. The forget operation only limits your access to the account on this browser.": "This operation does not remove the history of the account from the chain, nor any associated funds from the account. The forget operation only limits your access to the account on this browser.",
"This operation does not remove the history of the account from the chain, nor any associated funds from the account. The forget operation only limits your access to the address on this browser.": "This operation does not remove the history of the account from the chain, nor any associated funds from the account. The forget operation only limits your access to the address on this browser.",
"This operation does not remove the history of the contract from the chain, nor any associated funds from its account. The forget operation only limits your access to the contract on this browser.": "This operation does not remove the history of the contract from the chain, nor any associated funds from its account. The forget operation only limits your access to the contract on this browser.",
"Unbonding {{value}}, ": "Unbonding {{value}}, ",
"Unbonding {{value}}": "Unbonding {{value}}",
"Uncaught error. Something went wrong with the query and rendering of this component. {{message}}": "Uncaught error. Something went wrong with the query and rendering of this component. {{message}}",
"View this externally": "View this externally",
"Withdraw these unbonded funds": "Withdraw these unbonded funds",
@ -71,4 +71,4 @@
"{{blocks}} blocks": "{{blocks}} blocks",
"{{name}} ({{size}} bytes)": "{{name}} ({{size}} bytes)",
"{{value}}x voting balance, locked for {{lock}}x enactment ({{period}} days)": "{{value}}x voting balance, locked for {{lock}}x enactment ({{period}} days)"
}
}

View File

@ -630,7 +630,7 @@
"Unable to find on-chain WASM code for the supplied codeHash": "No se ha podido encontrar el código WASM de la cadena para el hash del código suministrado.",
"Unbond": "Desvincular",
"Unbond funds": "Desvincular fondos",
"Unbonding {{value}}, ": "Desvinculando {{value}},",
"Unbonding {{value}}": "Desvinculando {{value}}",
"Uncaught error. Something went wrong with the query and rendering of this component. {{message}}": "{{message}} Un error no descubierto. Algo salió mal con la consulta y la representación de este componente.",
"Unit": "Unidad",
"Unit decides the name of 1 unit token, e.g. \"DOT\" for Polkadot": "La unidad decide el nombre de un token de unidad, por ejemplo \"DOT\" para Polkadot",
@ -1115,4 +1115,4 @@
"{{threshold}}, not passing": "{{threshold}}, no pasará",
"{{threshold}}, passing": "{{threshold}}, de aprobación",
"{{value}}x voting balance, locked for {{lock}}x enactment ({{period}} days)": "{{value}}x saldo de votos, bloqueado por {{lock}}x sentencia ({{period}} días."
}
}

View File

@ -866,7 +866,7 @@
"Unbid": "Retierer l'enchère",
"Unbond": "Délier",
"Unbond funds": "Fonds déliés",
"Unbonding {{value}}, ": "Déliaison {{value}},",
"Unbonding {{value}}": "Déliaison {{value}}",
"Uncaught error. Something went wrong with the query and rendering of this component. {{message}}": "Une erreur non interceptée. Une erreur s'est produite avec la requête et le rendu de ce composant. {{message}}",
"Undelegate": "Supprimer la déléguation",
"Understood, close this": "J'ai compris, fermer",
@ -1519,4 +1519,4 @@
"{{threshold}}, not passing": "{{seuil} }, ne dépassant pas",
"{{threshold}}, passing": "{{seuil}}, passant",
"{{value}}x voting balance, locked for {{lock}}x enactment ({{period}} days)": "{{value}} x solde de vote, verrouillé pendant {{lock}} x décret ({{period}} jours)"
}
}

View File

@ -849,7 +849,7 @@
"Unbid": "Batalkan penawaran",
"Unbond": "Unbond",
"Unbond funds": "Unbond dana",
"Unbonding {{value}}, ": "Tidak terikat {{value}},",
"Unbonding {{value}}": "Tidak terikat {{value}}",
"Uncaught error. Something went wrong with the query and rendering of this component. {{message}}": "Kesalahan tidak tertangkap. Ada yang tidak beres dengan kueri dan rendering komponen ini. {{message}}",
"Undelegate": "Undelegasi",
"Unit": "Unit",
@ -1452,4 +1452,4 @@
"{{threshold}}, not passing": "{{threshold}}, tidak melewati",
"{{threshold}}, passing": "{{threshold}}, melewati",
"{{value}}x voting balance, locked for {{lock}}x enactment ({{period}} days)": "{{value}}x memilih saldo, terkunci untuk {{lock}}x berlaku ({{period}} hari)"
}
}

View File

@ -837,7 +837,7 @@
"Unbid": "Cancella l'offerta",
"Unbond": "Svincola",
"Unbond funds": "Svincola fondi",
"Unbonding {{value}}, ": "Svincolo {{value}},",
"Unbonding {{value}}": "Svincolo {{value}}",
"Uncaught error. Something went wrong with the query and rendering of this component. {{message}}": "Errore inatteso. Qualcosa è andato storto con l'interrogazione o con la lettura di qualche sua componente {{message}}",
"Undelegate": "Togli la delega",
"Unit": "Unità",
@ -1431,4 +1431,4 @@
"{{threshold}}, not passing": "{{threshold}}, respinta",
"{{threshold}}, passing": "{{threshold}}, approvato",
"{{value}}x voting balance, locked for {{lock}}x enactment ({{period}} days)": "{{value}} x moltiplicatore di voto, fondi bloccati per {{lock}}x = {{period}} giorni"
}
}

View File

@ -716,7 +716,7 @@
"Type the password chosen at the account creation. It was used to encrypt your account's private key in the backup file.": "계정 생성시 선택한 비밀번호를 입력하세요. 비밀번호는 백업파일에서 사용자 계정의 개인키를 암호화하는데 사용됩니다.",
"Unable to retrieve the specified block details. {{error}}": "지정된 블록 디테일을 찾을 수 없습니다 {{error}}",
"Unbid": "언비드",
"Unbonding {{value}}, ": "언본딩 {{value}},",
"Unbonding {{value}}": "언본딩 {{value}}",
"Uncaught error. Something went wrong with the query and rendering of this component. {{message}}": "발견하지 않은 오류. 퀴리 및 요소의 연주 시 이상이 있었습니다",
"Undelegate": "위임취소",
"Unit": "단위",
@ -1160,4 +1160,4 @@
"{{threshold}}, not passing": "{{threshold}}, 통과되지 않았습니다",
"{{threshold}}, passing": "{{threshold}}, 통과되었습니다",
"{{value}}x voting balance, locked for {{lock}}x enactment ({{period}} days)": "{{value}}x 투표 발란스, 잠금 {{lock}}x제정 ({{period}} days)"
}
}

View File

@ -634,7 +634,7 @@
"Unable to find on-chain WASM code for the supplied codeHash": "Não foi possível encontrar o código WASM na cadeia para o codeHash fornecido",
"Unbond": "Desvincular",
"Unbond funds": "Desvincular fundos",
"Unbonding {{value}}, ": "Desvinculando {{value}},",
"Unbonding {{value}}": "Desvinculando {{value}}",
"Uncaught error. Something went wrong with the query and rendering of this component. {{message}}": "Erro não capturado. Ocorreu um problema com a consulta e a renderização deste componente. {{mensagem}}",
"Unit": "Unidade",
"Unit decides the name of 1 unit token, e.g. \"DOT\" for Polkadot": "A unidade decide o nome de 1 token de unidade, por exemplo \"DOT\" para Polkadot",
@ -1122,4 +1122,4 @@
"{{threshold}}, not passing": "{{threshold}}, não passando",
"{{threshold}}, passing": "{{threshold}}, passando",
"{{value}}x voting balance, locked for {{lock}}x enactment ({{period}} days)": "{{value}} x saldo de votos, bloqueado por {{lock}} x promulgação ({{period}} dias)"
}
}

View File

@ -641,7 +641,7 @@
"Unable to find on-chain WASM code for the supplied codeHash": "Не найден WASM код для этого codeHash",
"Unbond": "Освободить",
"Unbond funds": "Освободить средства",
"Unbonding {{value}}, ": "Разблокирование {{value}}",
"Unbonding {{value}}": "Разблокирование {{value}}",
"Uncaught error. Something went wrong with the query and rendering of this component. {{message}}": "Неизвестная ошибка. Что-то пошло не так с запросом и показом этого компонента {{message}}",
"Unit": "Единица",
"Unit decides the name of 1 unit token, e.g. \"DOT\" for Polkadot": "Единица измерения определяет имя 1 единицы токена, например, \"DOT\" для Polkadot",
@ -1133,4 +1133,4 @@
"{{threshold}}, not passing": "{{threshold}}, не проходит",
"{{threshold}}, passing": "{{threshold}}, проходит",
"{{value}}x voting balance, locked for {{lock}}x enactment ({{period}} days)": "{{value}}x баланс голосования, заблокировано на {{lock}}x ({{period}} дней)"
}
}

View File

@ -821,7 +821,7 @@
"Unbid": "没有竞标",
"Unbond": "解除绑定",
"Unbond funds": "解除绑定资金",
"Unbonding {{value}}, ": "解除绑定{{value}}",
"Unbonding {{value}}": "解除绑定{{value}}",
"Uncaught error. Something went wrong with the query and rendering of this component. {{message}}": "未捕获的错误。此组件的查询和呈现出现问题。{{message}}",
"Undelegate": "不受委托的",
"Unit": "单位",
@ -1380,4 +1380,4 @@
"{{threshold}}, not passing": "{{threshold}},没有通过",
"{{threshold}}, passing": "{{threshold}}, 通过",
"{{value}}x voting balance, locked for {{lock}}x enactment ({{period}} days)": "{{value}}x投票余额,锁定 {{lock}}x 执行 ({{period}} days)"
}
}

View File

@ -270,7 +270,7 @@ function Account ({ account: { address, meta }, className = '', delegation, filt
onClick={toggleDelegate}
/>
)}
{ !!proxy?.[0].length && (
{!!proxy?.[0].length && (
<Badge
color='blue'
hover={t<string>('This account has {{proxyNumber}} proxy set.', {

View File

@ -19,15 +19,16 @@ interface Props {
stakingInfo?: DeriveStakingAccount;
}
function extractTotals (stakingInfo?: DeriveStakingAccount, progress?: DeriveSessionProgress): [[DeriveUnlocking, BN][], BN] {
function extractTotals (stakingInfo?: DeriveStakingAccount, progress?: DeriveSessionProgress): [[DeriveUnlocking, BN, BN][], BN] {
if (!stakingInfo?.unlocking || !progress) {
return [[], BN_ZERO];
}
const mapped = stakingInfo.unlocking
.filter(({ remainingEras, value }) => value.gt(BN_ZERO) && remainingEras.gt(BN_ZERO))
.map((unlock): [DeriveUnlocking, BN] => [
.map((unlock): [DeriveUnlocking, BN, BN] => [
unlock,
unlock.remainingEras,
unlock.remainingEras
.sub(BN_ONE)
.imul(progress.eraLength)
@ -63,17 +64,22 @@ function StakingUnbonding ({ className = '', stakingInfo }: Props): React.ReactE
/>
<FormatBalance value={total} />
<Tooltip
text={mapped.map(([{ value }, blocks], index): React.ReactNode => (
text={mapped.map(([{ value }, eras, blocks], index): React.ReactNode => (
<div
className='row'
key={index}
>
<div>{t<string>('Unbonding {{value}}, ', { replace: { value: formatBalance(value, { forceUnit: '-' }) } })}</div>
<div>{t<string>('Unbonding {{value}}', { replace: { value: formatBalance(value, { forceUnit: '-' }) } })}</div>
<div className='faded'>
<BlockToTime
blocks={blocks}
label={`${t<string>('{{blocks}} blocks', { replace: { blocks: formatNumber(blocks) } })}, `}
/>
{api.consts.babe.epochDuration
? (
<BlockToTime
blocks={blocks}
label={`${t<string>('{{blocks}} blocks', { replace: { blocks: formatNumber(blocks) } })}, `}
/>
)
: t<string>('{{eras}} eras remaining', { replace: { eras: formatNumber(eras) } })
}
</div>
</div>
))}