diff --git a/packages/page-poll/src/index.tsx b/packages/page-poll/src/index.tsx index 4f570fa8c8..73b513490a 100644 --- a/packages/page-poll/src/index.tsx +++ b/packages/page-poll/src/index.tsx @@ -69,8 +69,6 @@ function PollApp ({ className }: Props): React.ReactElement { ); } - console.error(turnout); - const blocksLeft = (api.consts.poll.end as BlockNumber).sub(bestNumber); const canVote = blocksLeft.gt(BN_ZERO); const options: [string, string, boolean, (value: boolean) => void][] = [ @@ -136,8 +134,12 @@ function PollApp ({ className }: Props): React.ReactElement {
) diff --git a/packages/react-components/src/CardSummary.tsx b/packages/react-components/src/CardSummary.tsx index f0da9c6d98..be917ba991 100644 --- a/packages/react-components/src/CardSummary.tsx +++ b/packages/react-components/src/CardSummary.tsx @@ -69,11 +69,18 @@ function CardSummary ({ children, className = '', help, label, progress }: Props
{!left || isUndefined(progress.total) ? '-' - : `${left}${progress.isPercent ? '' : '/'}${ - progress.isPercent - ? '%' - : formatNumber(progress.total) - }` + : !isTimed || progress.isPercent || !progress.value + ? `${left}${progress.isPercent ? '' : '/'}${ + progress.isPercent + ? '%' + : formatNumber(progress.total) + }` + : ( + + ) }
@@ -129,9 +136,13 @@ export default React.memo(styled(CardSummary)` } .isSecondary { - font-size: 1.1rem; - font-weight: normal; + font-size: 1rem; + font-weight: 100; margin-top: 0.25rem; + + .timer { + min-width: 8rem; + } } } diff --git a/packages/react-components/src/Progress.tsx b/packages/react-components/src/Progress.tsx index 2508666d2e..8fdf5e00dc 100644 --- a/packages/react-components/src/Progress.tsx +++ b/packages/react-components/src/Progress.tsx @@ -10,9 +10,11 @@ import { bnToBn, isBn, isUndefined } from '@polkadot/util'; interface Props { className?: string; + isDisabled?: boolean; percent?: BN | number; total?: UInt | BN | number; value?: UInt | BN | number; + withSummary?: boolean; } interface RotateProps { @@ -33,7 +35,7 @@ function DivClip ({ angle, type }: RotateProps): React.ReactElement const Clip = React.memo(DivClip); -function Progress ({ className = '', percent, total, value }: Props): React.ReactElement | null { +function Progress ({ className = '', isDisabled, percent, total, value, withSummary = true }: Props): React.ReactElement | null { const _total = bnToBn(total); const _value = bnToBn(value); const width = _total.gtn(0) @@ -49,7 +51,7 @@ function Progress ({ className = '', percent, total, value }: Props): React.Reac const angle = width * 360 / 100; return ( -
+
-
{width.toFixed(1)}%
+ {withSummary &&
{width.toFixed(1)}%
}
); @@ -76,11 +78,16 @@ function Progress ({ className = '', percent, total, value }: Props): React.Reac export default React.memo(styled(Progress)` border-radius: 100%; + clip-path: circle(50%); height: 4.5rem; - overflow: hidden; position: relative; width: 4.5rem; + &.isDisabled { + filter: grayscale(100%); + opacity: 0.25; + } + .background, .clip { bottom: 0;