diff --git a/packages/app-democracy/src/Overview/PreImage.tsx b/packages/app-democracy/src/Overview/PreImage.tsx index 437c273e907e..0bd127188304 100644 --- a/packages/app-democracy/src/Overview/PreImage.tsx +++ b/packages/app-democracy/src/Overview/PreImage.tsx @@ -3,29 +3,27 @@ // of the Apache-2.0 license. See the LICENSE file for details. 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 styled from 'styled-components'; -import { Button, Input, InputAddress, InputNumber, Extrinsic, Modal, Toggle, TxButton } from '@polkadot/react-components'; +import { Button, Input, InputAddress, 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'; -import translate from '../translate'; +import { useTranslation } from '../translate'; -interface Props extends I18nProps { +interface Props { + className?: string; onClose: () => void; } const ZERO_HASH = blake2AsHex(''); -function PreImage ({ className, onClose, t }: Props): React.ReactElement { +function PreImage ({ className, onClose }: Props): React.ReactElement { + const { t } = useTranslation(); 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(); @@ -67,20 +65,6 @@ function PreImage ({ className, onClose, t }: Props): React.ReactElement onChange={setIsImminent} value={isImminent} /> - {isImminent && ( - <> - - - - )} @@ -93,18 +77,12 @@ function PreImage ({ className, onClose, t }: Props): React.ReactElement @@ -114,11 +92,9 @@ function PreImage ({ className, onClose, t }: Props): React.ReactElement ); } -export default translate( - styled(PreImage)` - .toggleImminent { - margin: 0.5rem 0; - text-align: right; - } - ` -); +export default styled(PreImage)` + .toggleImminent { + margin: 0.5rem 0; + text-align: right; + } +`;