Small cleanups (duplication) (#3599)
This commit is contained in:
parent
bfb344b77d
commit
bc2e143ea9
@ -77,7 +77,7 @@
|
||||
"Aura": "هالة",
|
||||
"Authorize transaction": "السماح بالمعاملة",
|
||||
"Aye": "نعم",
|
||||
"Aye {{counter}}": "نعم {{عداد}}",
|
||||
"Aye {{count}}": "نعم {{عداد}}",
|
||||
"Aye, I approve": "نعم, أنا أوافق",
|
||||
"Aye, I can support this": "نعم ، يمكنني دعم هذا",
|
||||
"Aye, I support this": "نعم ، أنا أدعم هذا",
|
||||
@ -1278,4 +1278,4 @@
|
||||
"{{threshold}}, not passing": "سقف}}، لا يتم تمريره}}",
|
||||
"{{threshold}}, passing": "سقف}}، يتم تمريره}}",
|
||||
"{{value}}x voting balance, locked for {{lock}}x enactment ({{period}} days)": "({{قفل}} (تاريخ إصدار {{أيام}}x رصيد التصويت، مقفل لـ x {{قيمة }}"
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@ interface Props {
|
||||
function Voters ({ isAye, members, threshold, votes }: Props): React.ReactElement<Props> | null {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const counter = useMemo(
|
||||
const count = useMemo(
|
||||
(): string => {
|
||||
const num = threshold.toNumber();
|
||||
const max = isAye
|
||||
@ -33,7 +33,7 @@ function Voters ({ isAye, members, threshold, votes }: Props): React.ReactElemen
|
||||
[isAye, members, threshold, votes]
|
||||
);
|
||||
|
||||
if (!counter || !votes.length) {
|
||||
if (!count || !votes.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -41,8 +41,8 @@ function Voters ({ isAye, members, threshold, votes }: Props): React.ReactElemen
|
||||
<Expander
|
||||
summary={
|
||||
isAye
|
||||
? t<string>('Aye {{counter}}', { replace: { counter } })
|
||||
: t<string>('Nay {{counter}}', { replace: { counter } })
|
||||
? t<string>('Aye {{count}}', { replace: { count } })
|
||||
: t<string>('Nay {{count}}', { replace: { count } })
|
||||
}
|
||||
>
|
||||
{votes.map((address): React.ReactNode => (
|
||||
|
||||
@ -29,11 +29,7 @@ function TipCreate ({ members, refresh }: Props): React.ReactElement<Props> {
|
||||
const hasReason = reason?.length >= MIN_REASON_LEN && reason?.length <= MAX_REASON_LEN;
|
||||
|
||||
useEffect((): void => {
|
||||
setIsMember(
|
||||
accountId
|
||||
? members.includes(accountId)
|
||||
: false
|
||||
);
|
||||
setIsMember(members.includes(accountId || ''));
|
||||
}, [accountId, members]);
|
||||
|
||||
return (
|
||||
@ -110,7 +106,7 @@ function TipCreate ({ members, refresh }: Props): React.ReactElement<Props> {
|
||||
<TxButton
|
||||
accountId={accountId}
|
||||
icon='plus'
|
||||
isDisabled={!accountId || (isMember ? !hasValue : false) || !hasReason}
|
||||
isDisabled={!accountId || (isMember && !hasValue) || !hasReason}
|
||||
label={t<string>('Propose tip')}
|
||||
onStart={toggleOpen}
|
||||
onSuccess={refresh}
|
||||
|
||||
@ -275,7 +275,7 @@ function renderBalances (props: Props, allAccounts: string[], bestNumber: BlockN
|
||||
{formatBalance(balancesAll.vestingPerBlock)}
|
||||
<div className='faded'>{t('per block')}</div>
|
||||
<div className='faded'>
|
||||
<div>{`${t('until block')} ${formatNumber(balancesAll.vestingEndBlock)}`}</div>
|
||||
{`${t('until block')} ${formatNumber(balancesAll.vestingEndBlock)}`}
|
||||
<BlockToTime blocks={balancesAll.vestingEndBlock.sub(bestNumber)} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user