2018-05-22 14:31:27 +00:00
|
|
|
import EmbarkJS from 'Embark/EmbarkJS';
|
2018-05-23 18:45:29 +00:00
|
|
|
import ENSRegistry from 'Embark/contracts/ENSRegistry';
|
2018-05-30 19:00:54 +00:00
|
|
|
import ENSSubdomainRegistry from 'Embark/contracts/ENSSubdomainRegistry';
|
2018-06-05 00:34:56 +00:00
|
|
|
import PublicResolver from 'Embark/contracts/PublicResolver';
|
2018-05-29 20:51:19 +00:00
|
|
|
import TestToken from 'Embark/contracts/TestToken';
|
2018-05-22 14:31:27 +00:00
|
|
|
import React, { Fragment } from 'react';
|
|
|
|
import { Form, FormGroup, FormControl, HelpBlock, Button, ControlLabel } from 'react-bootstrap';
|
2018-05-27 20:28:07 +00:00
|
|
|
import AddDomain from './ens/addDomain';
|
|
|
|
import RegisterSubDomain from './ens/registerSubDomain';
|
2018-05-29 20:51:19 +00:00
|
|
|
import TokenPermissions from './standard/TokenPermission';
|
2018-05-27 20:28:07 +00:00
|
|
|
import SetupENS from './ens/setupENS';
|
2018-06-05 00:34:56 +00:00
|
|
|
import { hash } from 'eth-ens-namehash';
|
2018-05-22 14:31:27 +00:00
|
|
|
|
|
|
|
const FieldGroup = ({ id, label, help, ...props }) => (
|
|
|
|
<FormGroup controlId={id}>
|
|
|
|
<ControlLabel>{label}</ControlLabel>
|
|
|
|
<FormControl {...props} />
|
|
|
|
{help && <HelpBlock>{help}</HelpBlock>}
|
|
|
|
</FormGroup>
|
|
|
|
)
|
|
|
|
|
|
|
|
const ENSSubManagement = (props) => (
|
|
|
|
<Fragment>
|
2018-05-22 20:40:56 +00:00
|
|
|
<h2 style={{textAlign: 'center'}}>Subdomain Management</h2>
|
2018-05-27 20:28:07 +00:00
|
|
|
<h3>Add/Update Domain Price</h3>
|
2018-05-22 19:44:33 +00:00
|
|
|
<AddDomain />
|
2018-05-23 18:45:29 +00:00
|
|
|
<hr/>
|
2018-05-27 20:28:07 +00:00
|
|
|
<h3>Register Sub-Domain</h3>
|
|
|
|
<RegisterSubDomain />
|
|
|
|
<hr/>
|
2018-05-29 20:51:19 +00:00
|
|
|
<TokenPermissions
|
|
|
|
symbol='SNT'
|
2018-05-30 19:00:54 +00:00
|
|
|
spender={ENSSubdomainRegistry._address}
|
2018-05-29 20:51:19 +00:00
|
|
|
methods={TestToken.methods} />
|
|
|
|
<hr/>
|
2018-05-23 18:45:29 +00:00
|
|
|
<SetupENS ENSRegistry={ENSRegistry} />
|
2018-05-22 14:31:27 +00:00
|
|
|
</Fragment>
|
|
|
|
)
|
2018-05-23 18:45:29 +00:00
|
|
|
setTimeout(() => ENSRegistry.getPastEvents(
|
|
|
|
'allEvents',
|
|
|
|
{},
|
2018-06-05 00:34:56 +00:00
|
|
|
(err, res) => {
|
|
|
|
PublicResolver.methods.addr(hash('bobby.stateofus.eth')).call().then(res =>{
|
|
|
|
console.log('addr', res);
|
|
|
|
});
|
|
|
|
console.log(err, res) }), 2000)
|
2018-05-27 20:28:07 +00:00
|
|
|
|
|
|
|
export default ENSSubManagement;
|