mirror of
https://github.com/status-im/visual-identity.git
synced 2025-02-13 04:57:03 +00:00
Adding ProposalContainer component and changed module.exports to export default
This commit is contained in:
parent
c905809558
commit
3e44fa9b28
@ -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 {
|
||||
|
||||
|
33
app/components/voting-dapp/proposal-container.js
Normal file
33
app/components/voting-dapp/proposal-container.js
Normal file
@ -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;
|
18
app/components/voting-dapp/proposal-form.js
Normal file
18
app/components/voting-dapp/proposal-form.js
Normal file
@ -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;
|
11
app/components/voting-dapp/proposal-list.js
Normal file
11
app/components/voting-dapp/proposal-list.js
Normal file
@ -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;
|
@ -10,4 +10,4 @@ const Proposal = props => <div>
|
||||
|
||||
</div>
|
||||
|
||||
module.exports = Proposal;
|
||||
export default Proposal;
|
26
app/components/voting-dapp/voting-dapp.js
Normal file
26
app/components/voting-dapp/voting-dapp.js
Normal file
@ -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;
|
@ -7,6 +7,8 @@ import TopNavbar from './components/topnavbar';
|
||||
import TestTokenUI from './components/testtoken';
|
||||
import ERC20TokenUI from './components/erc20token';
|
||||
|
||||
import VotingDapp from './components/voting-dapp/voting-dapp';
|
||||
|
||||
import './dapp.css';
|
||||
|
||||
class App extends React.Component {
|
||||
@ -34,6 +36,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…
x
Reference in New Issue
Block a user