Bounties - Update summary (#4564)

This commit is contained in:
MiZiet 2021-02-02 10:18:59 +01:00 committed by GitHub
parent ad0a926909
commit e8972c8aba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 24 deletions

View File

@ -93,14 +93,11 @@
"Unassign Curator": "Unassign Curator",
"Unassign curator": "Unassign curator",
"Unassign curator under voting": "Unassign curator under voting",
"Value": "Value",
"You are giving up your curator role, the bounty will return to the Funded state. You will get your deposit back.": "You are giving up your curator role, the bounty will return to the Funded state. You will get your deposit back.",
"active": "active",
"award bounty": "award bounty",
"award with account": "award with account",
"beneficiary": "beneficiary",
"beneficiary account": "beneficiary account",
"bounties": "bounties",
"bounty bond": "bounty bond",
"bounty remark": "bounty remark",
"bounty requested allocation": "bounty requested allocation",
@ -112,9 +109,7 @@
"current curator": "current curator",
"next action": "next action",
"next bounty funding in": "next bounty funding in",
"next burn": "next burn",
"past": "past",
"payout due": "payout due",
"propose with account": "propose with account",
"proposing account": "proposing account",
"reject curator": "reject curator",
@ -124,7 +119,6 @@
"submit with account": "submit with account",
"title": "title",
"treasury": "treasury",
"update due": "update due",
"value": "value",
"vote with account": "vote with account",
"{{blocks}} blocks": "{{blocks}} blocks"

View File

@ -3,13 +3,14 @@
import React from 'react';
import { useBounties } from '@polkadot/app-bounties/hooks';
import { useTranslation } from '@polkadot/app-treasury/translate';
import { CardSummary, SummaryBox } from '@polkadot/react-components';
import Progress from '@polkadot/react-components/Progress';
import { useTreasury } from '@polkadot/react-hooks';
import { BlockToTime, FormatBalance } from '@polkadot/react-query';
import { useBounties } from './hooks';
import { useTranslation } from './translate';
interface Props {
activeBounties?: number;
className?: string;
@ -19,7 +20,7 @@ function Summary ({ activeBounties, className = '' }: Props): React.ReactElement
const { t } = useTranslation();
const { bestNumber, bountyIndex } = useBounties();
const { burn, spendPeriod, value } = useTreasury();
const { spendPeriod, value } = useTreasury();
return (
<SummaryBox className={`ui--BountySummary ${className}`}>
@ -32,14 +33,6 @@ function Summary ({ activeBounties, className = '' }: Props): React.ReactElement
{bountyIndex?.subn(activeBounties).toString()}
</CardSummary>
)}
{bestNumber && spendPeriod.gtn(0) && (
<CardSummary label={t<string>('next bounty funding in')}>
<BlockToTime
blocks={spendPeriod.sub(bestNumber.mod(spendPeriod))}
className='timer'
/>
</CardSummary>
)}
</section>
<section>
{value && (
@ -50,13 +43,11 @@ function Summary ({ activeBounties, className = '' }: Props): React.ReactElement
/>
</CardSummary>
)}
{burn && (
<CardSummary
label={t<string>('next burn')}
>
<FormatBalance
value={burn}
withSi
{bestNumber && spendPeriod.gtn(0) && (
<CardSummary label={t<string>('next bounty funding in')}>
<BlockToTime
blocks={spendPeriod.sub(bestNumber.mod(spendPeriod))}
className='timer'
/>
</CardSummary>
)}