diff --git a/app/components/ens/nameLookup.js b/app/components/ens/nameLookup.js index b13da8c..21df468 100644 --- a/app/components/ens/nameLookup.js +++ b/app/components/ens/nameLookup.js @@ -12,7 +12,7 @@ import { CopyToClipboard } from 'react-copy-to-clipboard'; import RegisterSubDomain from '../ens/registerSubDomain'; import StatusLogo from '../../ui/icons/components/StatusLogo' import EnsLogo from '../../ui/icons/logos/ens.png'; -const { getPrice } = ENSSubdomainRegistry.methods; +const { getPrice, getExpirationTime } = ENSSubdomainRegistry.methods; const invalidSuffix = '0000000000000000000000000000000000000000' const nullAddress = '0x0000000000000000000000000000000000000000' @@ -41,18 +41,20 @@ const backButton = { cursor: 'pointer' } +const generatePrettyDate = (timestamp) => new Date(timestamp * 1000).toDateString(); + class RenderAddresses extends PureComponent { state = { copied: false } render() { - const { domainName, address, statusAccount } = this.props + const { domainName, address, statusAccount, expirationTime } = this.props const { copied } = this.state const markCopied = (v) => { this.setState({ copied: v }) } const isCopied = address => address == copied; const renderCopied = address => isCopied(address) && Copied!; return (
- {formatName(domainName).toUpperCase()} Resolves To: + {formatName(domainName).toUpperCase()}{expirationTime && (Expires {generatePrettyDate(expirationTime)})} Resolves To: {address && Ethereum Address {renderCopied(address)}}
{address}
@@ -163,6 +165,7 @@ const InnerForm = ({ domainName={values.domainName} address={status.address} statusAccount={status.statusAccount} + expirationTime={status.expirationTime} setStatus={setStatus} /> :