Merge branch '000-snt-voting-dapp' of https://github.com/status-im/contracts into 000-snt-voting-dapp
This commit is contained in:
commit
39234c5d92
|
@ -1,7 +1,7 @@
|
|||
import EmbarkJS from 'Embark/EmbarkJS';
|
||||
import React from 'react';
|
||||
import { Navbar, NavItem, Nav, MenuItem , NavDropdown} from 'react-bootstrap';
|
||||
import AccountList from './accountList';
|
||||
import AccountList from './accountlist';
|
||||
|
||||
class TopNavbar extends React.Component {
|
||||
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
import web3 from "Embark/web3"
|
||||
import EmbarkJS from 'Embark/EmbarkJS';
|
||||
import React from 'react';
|
||||
|
||||
import ProposalForm from './proposal-form';
|
||||
import Proposal from './proposal';
|
||||
import ProposalList from './proposal-list';
|
||||
|
||||
class ProposalContainer extends React.Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
proposals: []
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount(){
|
||||
this.fetchProposals(_p => this.setState({proposals: _p}));
|
||||
}
|
||||
|
||||
fetchProposals(cb){
|
||||
// TODO: populate proposals
|
||||
cb([1, 2, 3]);
|
||||
}
|
||||
|
||||
render(){
|
||||
return <ProposalList proposals={this.state.proposals} />;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default ProposalContainer;
|
|
@ -0,0 +1,18 @@
|
|||
import web3 from "Embark/web3"
|
||||
import EmbarkJS from 'Embark/EmbarkJS';
|
||||
import React from 'react';
|
||||
|
||||
class ProposalForm extends React.Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {};
|
||||
}
|
||||
|
||||
render(){
|
||||
return <div>TODO: Form</div>;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default ProposalForm;
|
|
@ -0,0 +1,11 @@
|
|||
import React from 'react';
|
||||
import Proposal from './proposal';
|
||||
|
||||
const ProposalList = props =>
|
||||
<React.Fragment>
|
||||
{props.proposals.map((u, i) => (
|
||||
<Proposal key={i} data={u} />
|
||||
))}
|
||||
</React.Fragment>
|
||||
|
||||
export default ProposalList;
|
|
@ -0,0 +1,13 @@
|
|||
import React from 'react';
|
||||
|
||||
const Proposal = props => <div>
|
||||
{ props.data.topic }
|
||||
|
||||
BUILD SOME AWESOME STUFF
|
||||
This is a random text related to the previous title
|
||||
Votes: 10 / 500
|
||||
[Vote]
|
||||
|
||||
</div>
|
||||
|
||||
export default Proposal;
|
|
@ -0,0 +1,26 @@
|
|||
import web3 from "Embark/web3"
|
||||
import EmbarkJS from 'Embark/EmbarkJS';
|
||||
import React from 'react';
|
||||
|
||||
import ProposalForm from './proposal-form';
|
||||
import ProposalContainer from './proposal-container';
|
||||
|
||||
class VotingDapp extends React.Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
render(){
|
||||
return <div>
|
||||
<ProposalContainer />
|
||||
<ProposalForm />
|
||||
</div>;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default VotingDapp;
|
|
@ -8,6 +8,8 @@ import TestTokenUI from './components/testtoken';
|
|||
import ERC20TokenUI from './components/erc20token';
|
||||
import ProposalManager from './components/proposalManager'
|
||||
|
||||
import VotingDapp from './components/voting-dapp/voting-dapp';
|
||||
|
||||
import './dapp.css';
|
||||
|
||||
class App extends React.Component {
|
||||
|
@ -35,6 +37,9 @@ class App extends React.Component {
|
|||
<div>
|
||||
<TopNavbar />
|
||||
<Tabs defaultActiveKey={1} id="uncontrolled-tab-example">
|
||||
<Tab eventKey={0} title="VotingDapp">
|
||||
<VotingDapp />
|
||||
</Tab>
|
||||
<Tab eventKey={1} title="TestToken">
|
||||
<TestTokenUI />
|
||||
</Tab>
|
||||
|
|
Loading…
Reference in New Issue