This repository has been archived by the owner on Nov 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from rnsdomains/registration
Registration
- Loading branch information
Showing
29 changed files
with
3,610 additions
and
337 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
build/ | ||
node_modules/ | ||
.DS_Store | ||
.secret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
REACT_APP_RSK_NODE=https://public-node.rsk.co/ | ||
REACT_APP_RNS_REGISTRY=0xcb868aeabd31e2b66f74e9a55cf064abb31a4ad5 | ||
REACT_APP_BATCH_REGISTRAR=0x1867670c5eee8a850462ffb5d7b5f4eb25b0ffab | ||
REACT_APP_RSK_EXPLORER=https://explorer.rsk.co |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React from 'react'; | ||
import { Container, Row, Col } from 'react-bootstrap'; | ||
|
||
export default () => ( | ||
<Container> | ||
<Row> | ||
<div className="col-lg-12 text-center main-title-box"> | ||
<h1><b>Admin</b></h1> | ||
</div> | ||
<Col> | ||
<ul> | ||
<li>Add registrant</li> | ||
<li>Remove registrant</li> | ||
<li>Check registrant</li> | ||
<li>Recover domain ownership</li> | ||
</ul> | ||
</Col> | ||
</Row> | ||
<Row> | ||
<Col> | ||
<p> | ||
This section is in development. Find the | ||
<span> </span> | ||
<a href="https://github.com/rnsdomains/rns-subdomain-batch/projects/1" target="_blank" rel="noopener noreferrer">Github project</a> | ||
<span> </span> | ||
to collaborate. | ||
</p> | ||
</Col> | ||
</Row> | ||
</Container> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
import React, { Component } from 'react'; | ||
import { | ||
Container, Row, Col, Form, FormControl, Button, InputGroup, Spinner, | ||
} from 'react-bootstrap'; | ||
import { connect } from 'react-redux'; | ||
import { auth } from '../operations'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
class ValidateOwnershipComponent extends Component { | ||
constructor(props) { | ||
super(props); | ||
|
||
this.state = { | ||
value: '', | ||
}; | ||
|
||
this.authenticate = this.authenticate.bind(this); | ||
this.handleChangeValue = this.handleChangeValue.bind(this); | ||
} | ||
|
||
handleChangeValue(e) { | ||
this.setState({ value: e.target.value }); | ||
} | ||
|
||
authenticate(event) { | ||
event.preventDefault(); | ||
const { auth } = this.props; | ||
const { value } = this.state; | ||
|
||
auth(value); | ||
} | ||
|
||
render() { | ||
const { authenticating, error, permissions, domain } = this.props; | ||
|
||
return ( | ||
<Container className="text-center"> | ||
<Row> | ||
<Col> | ||
{ | ||
permissions.length === 0 ? | ||
<Form onSubmit={this.authenticate}> | ||
<Form.Group> | ||
<InputGroup> | ||
<FormControl type="text" placeholder="domain.rsk" disabled={authenticating} onChange={this.handleChangeValue} /> | ||
<InputGroup.Append> | ||
<Button type="submit" disabled={authenticating}>Log in</Button> | ||
</InputGroup.Append> | ||
</InputGroup> | ||
{ | ||
authenticating && <Spinner variant="grow" /> | ||
} | ||
{ | ||
error | ||
&& ( | ||
<> | ||
<small className="text-danger">{error}</small> | ||
<br /> | ||
<small> | ||
Check you are connected to RSK network with | ||
<span> </span> | ||
the owner&aposs wallet unlocked. | ||
</small> | ||
</> | ||
) | ||
} | ||
</Form.Group> | ||
</Form> : | ||
<> | ||
<p>Welcome {domain}!</p> | ||
<Link className="btn btn-success" to="/subdomains">Register subdomains</Link> | ||
</> | ||
} | ||
</Col> | ||
</Row> | ||
<hr /> | ||
<Row> | ||
<Col> | ||
<p> | ||
Please complete the | ||
<span> </span><Link to="/setup">setup</Link><span> </span> | ||
before logging in. | ||
</p> | ||
</Col> | ||
</Row> | ||
</Container> | ||
); | ||
} | ||
} | ||
|
||
const mapStateToProps = ({ app }) => ({ | ||
permissions: app.auth.permissions, | ||
authenticating: app.auth.authenticating, | ||
error: app.auth.error, | ||
domain: app.domain, | ||
}); | ||
|
||
const mapDispatchToProps = (dispatch) => ({ | ||
auth: (domain) => dispatch(auth(domain)), | ||
}); | ||
|
||
export default connect( | ||
mapStateToProps, | ||
mapDispatchToProps, | ||
)(ValidateOwnershipComponent); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.