add screen for finishing registration

This commit is contained in:
Barry Gitarts 2018-08-20 15:31:12 -04:00
parent c9e940b211
commit 2b9b71359b
4 changed files with 39 additions and 6 deletions

View File

@ -0,0 +1,16 @@
export default {
release: {
title: {
sub: 'Done!',
body: 'The released domain will be available to other users'
},
subheading: 'Follow the progress in the Transaction History section of your wallet.'
},
registered: {
title: {
sub: 'Nice!',
body: 'The name is yours once the transaction is complete'
},
subheading: 'Follow the progress in the Transaction History section of your wallet.'
}
}

View File

@ -24,6 +24,7 @@ import CheckCircle from '../../ui/icons/components/baseline_check_circle_outline
const { getPrice, getExpirationTime, release } = ENSSubdomainRegistry.methods;
import NotInterested from '@material-ui/icons/NotInterested';
import Face from '@material-ui/icons/Face';
import Copy from './copy';
const invalidSuffix = '0000000000000000000000000000000000000000'
const nullAddress = '0x0000000000000000000000000000000000000000'
@ -172,6 +173,19 @@ const RegisterInfoCard = ({ formattedDomain, domainPrice }) => (
</Fragment>
)
const TransactionComplete = ({ type }) => (
<div style={{ textAlign: 'center', margin: '40% 15 10' }}>
<Typography variant="title" style={{ marginBottom: '1rem' }}>
{Copy[type]['title']['sub']}<br/>
{Copy[type]['title']['body']}
</Typography>
<Typography variant="subheading" style={{ color: '#939BA1' }}>
{Copy[type]['subheading']}
</Typography>
<MobileButton text="Main Page" style={{ marginTop: '12rem' }} />
</div>
);
class Register extends PureComponent {
state = { domainPrice: null };
@ -191,21 +205,22 @@ class Register extends PureComponent {
render() {
const { domainName, setStatus, style } = this.props;
const { domainPrice, registered } = this.state;
const { domainPrice, registered, submitted } = this.state;
const formattedDomain = formatName(domainName);
const formattedDomainArray = formattedDomain.split('.')
const formattedDomainArray = formattedDomain.split('.');
return (
<div style={style}>
{!registered ?
{!registered && !submitted ?
<Fragment>
<RegisterInfoCard {...{ formattedDomain, domainPrice }}/>
<RegisterSubDomain
subDomain={formattedDomainArray[0]}
domainName={formattedDomainArray.slice(1).join('.')}
domainPrice={domainPrice}
preRegisteredCallback={() => { this.setState({ submitted: true }) }}
registeredCallbackFn={this.onRegistered} />
</Fragment> :
<RenderAddresses {...this.props} address={registered.address} statusAccount={registered.statusAccount} />}
submitted && !registered ? <TransactionComplete type="registered" /> : <RenderAddresses {...this.props} address={registered.address} statusAccount={registered.statusAccount} />}
</div>
)
}

View File

@ -174,6 +174,7 @@ const RegisterSubDomain = withFormik({
toSend.estimateGas().then(gasEstimated => {
console.log("Register would work. :D Gas estimated: "+gasEstimated)
console.log("Trying: register(\""+subdomainHash+"\",\""+domainNameHash+"\",\""+resolveToAddr+"\",\""+zeroBytes32+"\",\""+zeroBytes32+"\")")
props.preRegisteredCallback && props.preRegisteredCallback();
toSend.send({gas: gasEstimated+1000}).then(txId => {
if(txId.status == "0x1" || txId.status == "0x01"){
console.log("Register send success. :)")

View File

@ -3,7 +3,7 @@
"Black Ash": "#3B3B3B",
"Dim Grey": "#707070",
"Dust Grey": "#969696",
"Light Grey": "#B3B3B3",
"Light Grey": "#939ba1",
"Gainsboro": "#E6E6E6",
"Alabaster": "#F2F2F2"
},
@ -61,7 +61,8 @@
"Secondary": "=Sea.Turquoise",
"Black Ash": "=Grey.Black Ash",
"Gradient Start": "=Eagle.Cerulean",
"Gradient End": "=Eagle.Opal"
"Gradient End": "=Eagle.Opal",
"SubText": "=Grey.Light Grey"
},
"Status UI": {
"gradientStart": "=Blue.Main",