diff --git a/packages/page-contracts/src/Contracts/Contract.tsx b/packages/page-contracts/src/Contracts/Contract.tsx index ec94fceda3..f10c584d1e 100644 --- a/packages/page-contracts/src/Contracts/Contract.tsx +++ b/packages/page-contracts/src/Contracts/Contract.tsx @@ -4,18 +4,17 @@ import type { ContractCallOutcome } from '@polkadot/api-contract/types'; import type { ActionStatus } from '@polkadot/react-components/Status/types'; import type { Option } from '@polkadot/types'; -import type { BlockNumber, ContractInfo } from '@polkadot/types/interfaces'; +import type { ContractInfo } from '@polkadot/types/interfaces'; import type { ContractLink } from './types'; -import React, { useCallback, useEffect, useState } from 'react'; +import React, { useCallback } from 'react'; import styled from 'styled-components'; import { ContractPromise } from '@polkadot/api-contract'; import { AddressInfo, AddressMini, Button, Forget } from '@polkadot/react-components'; -import { useApi, useBestNumber, useCall, useToggle } from '@polkadot/react-hooks'; -import { BlockToTime } from '@polkadot/react-query'; +import { useApi, useCall, useToggle } from '@polkadot/react-hooks'; import { keyring } from '@polkadot/ui-keyring'; -import { formatNumber, isFunction, isUndefined } from '@polkadot/util'; +import { isUndefined } from '@polkadot/util'; import Messages from '../shared/Messages'; import { useTranslation } from '../translate'; @@ -35,20 +34,9 @@ function transformInfo (optInfo: Option): ContractInfo | null { function Contract ({ className, contract, index, links, onCall }: Props): React.ReactElement | null { const { t } = useTranslation(); const { api } = useApi(); - const bestNumber = useBestNumber(); const info = useCall(api.query.contracts.contractInfoOf, [contract.address], { transform: transformInfo }); - const [evictAt, setEvictAt] = useState(null); const [isForgetOpen, toggleIsForgetOpen] = useToggle(); - useEffect((): void => { - if (info && isFunction(api.rpc.contracts?.rentProjection)) { - api.rpc.contracts - .rentProjection(contract.address) - .then((value) => setEvictAt(value.unwrapOr(null))) - .catch(() => undefined); - } - }, [api, contract, info]); - const _onCall = useCallback( (messageIndex: number, resultCb: (messageIndex: number, result?: ContractCallOutcome) => void) => onCall(index, messageIndex, resultCb), @@ -122,18 +110,6 @@ function Contract ({ className, contract, index, links, onCall }: Props): React. : t('Not on-chain') )} - - {bestNumber && ( - evictAt - ? ( - <> - - #{formatNumber(evictAt)} - - ) - : t('None') - )} -