From 8e69076c85be6a6a30006d69bc844244e333c97e Mon Sep 17 00:00:00 2001 From: Barry Gitarts Date: Thu, 7 Jun 2018 17:55:50 -0400 Subject: [PATCH] add initial display of status account in resolver UI --- app/components/ens/nameLookup.js | 30 ++++++++++++++++--------- app/components/ens/registerSubDomain.js | 29 ++++++++++++++++-------- 2 files changed, 40 insertions(+), 19 deletions(-) diff --git a/app/components/ens/nameLookup.js b/app/components/ens/nameLookup.js index 24d6ac1..4ddc8b6 100644 --- a/app/components/ens/nameLookup.js +++ b/app/components/ens/nameLookup.js @@ -23,12 +23,15 @@ const addressStyle = { fontSize: '18px', fontWeight: 400, margin: '3% 0 3% 0', - cursor: 'copy' + cursor: 'copy', + textAlign: 'center', + wordWrap: 'break-word' } const backButton = { fontSize: '40px', - color: theme.accent + color: theme.accent, + cursor: 'pointer' } class DisplayAddress extends PureComponent { @@ -36,7 +39,7 @@ class DisplayAddress extends PureComponent { render() { const { copied } = this.state - const { domainName, address, setStatus } = this.props + const { domainName, address, statusAccount, setStatus } = this.props const markCopied = () => { this.setState({ copied: !copied }) } const validAddress = address != nullAddress; return ( @@ -47,6 +50,9 @@ class DisplayAddress extends PureComponent {
{address}
+ +
{statusAccount}
+
{copied && COPIED @@ -85,19 +91,23 @@ const InnerForm = ({ Get Address - : } + : } ) const NameLookup = withFormik({ mapPropsToValues: props => ({ domainName: '' }), - handleSubmit(values, { setSubmitting, setStatus }) { + async handleSubmit(values, { status, setSubmitting, setStatus }) { const { domainName } = values; - PublicResolver.methods.addr(hash(formatName(domainName))) - .call() - .then(res =>{ - setStatus(res) - }); + const { addr, text } = PublicResolver.methods; + const lookupHash = hash(formatName(domainName)); + const address = await addr(lookupHash).call(); + const statusAccount = await text(lookupHash, 'statusAccount').call(); + setStatus({ address, statusAccount }); } })(InnerForm) diff --git a/app/components/ens/registerSubDomain.js b/app/components/ens/registerSubDomain.js index 2e0a8e4..27d49b5 100644 --- a/app/components/ens/registerSubDomain.js +++ b/app/components/ens/registerSubDomain.js @@ -55,11 +55,21 @@ const InnerForm = ({ label="Domain Price" disabled value={values.price ? `${Number(values.price).toLocaleString()} SNT` : ''} /> + { console.log("Register would work. :D Gas estimated: "+gasEstimated)