diff --git a/packages/page-bounties/src/DueBlocks.tsx b/packages/page-bounties/src/DueBlocks.tsx
index a46162a9f7..c6ab6ad902 100644
--- a/packages/page-bounties/src/DueBlocks.tsx
+++ b/packages/page-bounties/src/DueBlocks.tsx
@@ -18,7 +18,7 @@ function DueBlocks ({ dueBlocks, endBlock, label }: Props): React.ReactElement
{dueBlocks.gtn(0) && (
<>
-
+
({label})
#{formatNumber(endBlock)}
diff --git a/packages/page-contracts/src/Contracts/Contract.tsx b/packages/page-contracts/src/Contracts/Contract.tsx
index 886536faff..b7afe01294 100644
--- a/packages/page-contracts/src/Contracts/Contract.tsx
+++ b/packages/page-contracts/src/Contracts/Contract.tsx
@@ -126,7 +126,7 @@ function Contract ({ className, contract, index, links, onCall }: Props): React.
evictAt
? (
<>
-
+
#{formatNumber(evictAt)}
>
)
diff --git a/packages/page-council/src/Motions/Motion.tsx b/packages/page-council/src/Motions/Motion.tsx
index 94485cc54a..fe9bc53060 100644
--- a/packages/page-council/src/Motions/Motion.tsx
+++ b/packages/page-council/src/Motions/Motion.tsx
@@ -81,7 +81,7 @@ function Motion ({ className = '', isMember, members, motion: { hash, proposal,
|
{remainingBlocks && end && (
<>
-
+
#{formatNumber(end)}
>
)}
diff --git a/packages/page-democracy/src/Execute/DispatchEntry.tsx b/packages/page-democracy/src/Execute/DispatchEntry.tsx
index 0e19a01884..b3976beda0 100644
--- a/packages/page-democracy/src/Execute/DispatchEntry.tsx
+++ b/packages/page-democracy/src/Execute/DispatchEntry.tsx
@@ -30,7 +30,7 @@ function DispatchEntry ({ value: { at, image, imageHash, index } }: Props): Reac
|
{bestNumber && (
<>
-
+
#{formatNumber(at)}
>
)}
diff --git a/packages/page-democracy/src/Execute/Scheduled.tsx b/packages/page-democracy/src/Execute/Scheduled.tsx
index e5a773c89c..15e17b98da 100644
--- a/packages/page-democracy/src/Execute/Scheduled.tsx
+++ b/packages/page-democracy/src/Execute/Scheduled.tsx
@@ -33,7 +33,7 @@ function Scheduled ({ className = '', value: { blockNumber, call, maybeId, maybe
|
{bestNumber && (
<>
-
+
#{formatNumber(blockNumber)}
>
)}
diff --git a/packages/page-democracy/src/Overview/Referendum.tsx b/packages/page-democracy/src/Overview/Referendum.tsx
index e4b66e9f72..c2942303b2 100644
--- a/packages/page-democracy/src/Overview/Referendum.tsx
+++ b/packages/page-democracy/src/Overview/Referendum.tsx
@@ -92,11 +92,11 @@ function Referendum ({ className = '', value: { allAye, allNay, image, imageHash
proposal={image?.proposal}
/>
|
-
+
{t('{{blocks}} blocks', { replace: { blocks: formatNumber(remainBlock) } })}
|
-
+
#{formatNumber(enactBlock)}
|
diff --git a/packages/page-explorer/src/Summary.tsx b/packages/page-explorer/src/Summary.tsx
index 3387dc9137..8096c52075 100644
--- a/packages/page-explorer/src/Summary.tsx
+++ b/packages/page-explorer/src/Summary.tsx
@@ -25,7 +25,7 @@ function Summary (): React.ReactElement {
className='media--800'
label={t('target')}
>
-
+
{api.query.balances && (
|
{blocksLeft && (
-
+
)}
#{formatNumber(end)}
|
diff --git a/packages/page-parachains/src/Overview/Lifecycle.tsx b/packages/page-parachains/src/Overview/Lifecycle.tsx
new file mode 100644
index 0000000000..50710f3121
--- /dev/null
+++ b/packages/page-parachains/src/Overview/Lifecycle.tsx
@@ -0,0 +1,27 @@
+// Copyright 2017-2021 @polkadot/app-parachains authors & contributors
+// SPDX-License-Identifier: Apache-2.0
+
+import type { ParaLifecycle } from '@polkadot/types/interfaces';
+import type { QueuedAction } from './types';
+
+import React from 'react';
+
+import { SessionToTime } from '@polkadot/react-query';
+
+interface Props {
+ lifecycle: ParaLifecycle | null;
+ nextAction?: QueuedAction;
+}
+
+function Lifecycle ({ lifecycle, nextAction }: Props): React.ReactElement | null {
+ return lifecycle && (
+ <>
+ {lifecycle.toString()}
+ {nextAction && (
+
+ )}
+ >
+ );
+}
+
+export default React.memo(Lifecycle);
diff --git a/packages/page-parachains/src/Overview/Parachain.tsx b/packages/page-parachains/src/Overview/Parachain.tsx
index aa35268429..c66a62e349 100644
--- a/packages/page-parachains/src/Overview/Parachain.tsx
+++ b/packages/page-parachains/src/Overview/Parachain.tsx
@@ -4,6 +4,7 @@
import type { Option, Vec } from '@polkadot/types';
import type { AccountId, BlockNumber, HeadData, Header, ParaId, ParaLifecycle } from '@polkadot/types/interfaces';
import type { Codec } from '@polkadot/types/types';
+import type { QueuedAction } from './types';
import BN from 'bn.js';
import React, { useCallback, useMemo } from 'react';
@@ -15,6 +16,7 @@ import { formatNumber } from '@polkadot/util';
import { useTranslation } from '../translate';
import { sliceHex } from '../util';
+import Lifecycle from './Lifecycle';
interface Props {
bestNumber?: BN;
@@ -23,6 +25,7 @@ interface Props {
isScheduled?: boolean;
lastBacked?: [string, string, BN];
lastInclusion?: [string, string, BN];
+ nextAction?: QueuedAction;
validators?: AccountId[];
}
@@ -68,7 +71,7 @@ const optionsMulti = {
})
};
-function Parachain ({ bestNumber, className = '', id, isScheduled, lastBacked, lastInclusion, validators }: Props): React.ReactElement {
+function Parachain ({ bestNumber, className = '', id, isScheduled, lastBacked, lastInclusion, nextAction, validators }: Props): React.ReactElement {
const { t } = useTranslation();
const { api } = useApi();
const { api: paraApi } = useParaApi(id);
@@ -125,7 +128,10 @@ function Parachain ({ bestNumber, className = '', id, isScheduled, lastBacked, l
{paraInfo.headHex} |
- {paraInfo.lifecycle && paraInfo.lifecycle.toString()}
+
|
|
{blockDelay && } |
@@ -144,7 +150,7 @@ function Parachain ({ bestNumber, className = '', id, isScheduled, lastBacked, l
{paraInfo.updateAt && bestNumber && (
<>
-
+
#{formatNumber(paraInfo.updateAt)}
>
)}
diff --git a/packages/page-parachains/src/Overview/ParachainList.tsx b/packages/page-parachains/src/Overview/Parachains.tsx
similarity index 93%
rename from packages/page-parachains/src/Overview/ParachainList.tsx
rename to packages/page-parachains/src/Overview/Parachains.tsx
index 9362dc9ad7..961f788152 100644
--- a/packages/page-parachains/src/Overview/ParachainList.tsx
+++ b/packages/page-parachains/src/Overview/Parachains.tsx
@@ -4,6 +4,7 @@
import type { SignedBlockExtended } from '@polkadot/api-derive/type';
import type { AccountId, CandidateReceipt, Event, ParaId, ParaValidatorIndex } from '@polkadot/types/interfaces';
import type { ScheduledProposals } from '../types';
+import type { QueuedAction } from './types';
import BN from 'bn.js';
import React, { useEffect, useMemo, useRef, useState } from 'react';
@@ -15,6 +16,7 @@ import { useTranslation } from '../translate';
import Parachain from './Parachain';
interface Props {
+ actionsQueue: QueuedAction[];
ids?: ParaId[];
scheduled?: ScheduledProposals[];
}
@@ -42,7 +44,7 @@ function includeEntry (map: EventMap, event: Event, blockHash: string, blockNumb
}
}
-function ParachainList ({ ids, scheduled }: Props): React.ReactElement {
+function Parachains ({ actionsQueue, ids, scheduled }: Props): React.ReactElement {
const { t } = useTranslation();
const { api } = useApi();
const bestNumber = useBestNumber();
@@ -131,6 +133,9 @@ function ParachainList ({ ids, scheduled }: Props): React.ReactElement {
key={id.toString()}
lastBacked={lastBacked[id.toString()]}
lastInclusion={lastIncluded[id.toString()]}
+ nextAction={actionsQueue.find(({ paraIds }) =>
+ paraIds.some((p) => p.eq(id))
+ )}
validators={validatorMap[index]}
/>
))}
@@ -138,4 +143,4 @@ function ParachainList ({ ids, scheduled }: Props): React.ReactElement {
);
}
-export default React.memo(ParachainList);
+export default React.memo(Parachains);
diff --git a/packages/page-parachains/src/Overview/Parathread.tsx b/packages/page-parachains/src/Overview/Parathread.tsx
new file mode 100644
index 0000000000..eee19d46e9
--- /dev/null
+++ b/packages/page-parachains/src/Overview/Parathread.tsx
@@ -0,0 +1,94 @@
+// Copyright 2017-2021 @polkadot/app-parachains authors & contributors
+// SPDX-License-Identifier: Apache-2.0
+
+import type { Option, Vec } from '@polkadot/types';
+import type { AccountId, BalanceOf, HeadData, ParaId, ParaLifecycle } from '@polkadot/types/interfaces';
+import type { ITuple } from '@polkadot/types/types';
+import type { LeaseInfo, QueuedAction } from './types';
+
+import BN from 'bn.js';
+import React from 'react';
+
+import { ParaLink } from '@polkadot/react-components';
+import { useApi, useCallMulti } from '@polkadot/react-hooks';
+import { formatNumber } from '@polkadot/util';
+
+import { sliceHex } from '../util';
+import Lifecycle from './Lifecycle';
+
+interface Props {
+ className?: string;
+ currentPeriod: BN | null;
+ id: ParaId;
+ nextAction?: QueuedAction;
+}
+
+type QueryResult = [Option, Option, Vec |