diff --git a/packages/app-democracy/src/Overview/PreImage.tsx b/packages/app-democracy/src/Overview/PreImage.tsx index e1685ff4532..774d3e5cb58 100644 --- a/packages/app-democracy/src/Overview/PreImage.tsx +++ b/packages/app-democracy/src/Overview/PreImage.tsx @@ -5,8 +5,10 @@ import { SubmittableExtrinsic } from '@polkadot/api/promise/types'; import { I18nProps } from '@polkadot/react-components/types'; +import BN from 'bn.js'; import React, { useEffect, useState } from 'react'; -import { Button, Input, InputAddress, Extrinsic, Modal, TxButton } from '@polkadot/react-components'; +import styled from 'styled-components'; +import { Button, Input, InputAddress, InputNumber, Extrinsic, Modal, Toggle, TxButton } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import { Available } from '@polkadot/react-query'; import { blake2AsHex } from '@polkadot/util-crypto'; @@ -22,6 +24,9 @@ const ZERO_HASH = blake2AsHex(''); function PreImage ({ className, onClose, t }: Props): React.ReactElement { const { apiDefaultTxSudo } = useApi(); const [accountId, setAccountId] = useState(null); + const [atBlock, setAtBlock] = useState(); + const [forProposal, setForProposal] = useState(); + const [isImminent, setIsImminent] = useState(false); const [{ hex, hash }, setHash] = useState<{ hex: string; hash: string }>({ hex: '', hash: ZERO_HASH }); const [proposal, setProposal] = useState(); @@ -57,6 +62,26 @@ function PreImage ({ className, onClose, t }: Props): React.ReactElement label={t('preimage hash')} value={hash} /> + + {isImminent && ( + <> + + + + )} @@ -69,13 +94,19 @@ function PreImage ({ className, onClose, t }: Props): React.ReactElement @@ -84,4 +115,11 @@ function PreImage ({ className, onClose, t }: Props): React.ReactElement ); } -export default translate(PreImage); +export default translate( + styled(PreImage)` + .toggleImminent { + margin: 0.5rem 0; + text-align: right; + } + ` +);