visual-identity/app/dapp.js

61 lines
1.5 KiB
JavaScript
Raw Normal View History

2018-05-13 04:31:01 +00:00
import React from 'react';
import ReactDOM from 'react-dom';
import { Tabs, Tab } from 'react-bootstrap';
import EmbarkJS from 'Embark/EmbarkJS';
2018-05-17 19:53:23 +00:00
import TopNavbar from './components/topnavbar';
2018-05-13 04:31:01 +00:00
import TestTokenUI from './components/testtoken';
import ERC20TokenUI from './components/erc20token';
2018-05-21 21:42:23 +00:00
import ProposalManager from './components/proposalManager'
2018-05-13 04:31:01 +00:00
import VotingDapp from './components/voting-dapp/voting-dapp';
2018-05-13 04:31:01 +00:00
import './dapp.css';
class App extends React.Component {
constructor(props) {
super(props);
}
2018-05-21 18:29:57 +00:00
componentDidMount(){
2018-05-13 04:31:01 +00:00
__embarkContext.execWhenReady(() => {
});
}
2018-05-22 13:49:22 +00:00
setAccount(_account){
this.setState({account: _account});
}
2018-05-13 04:31:01 +00:00
2018-05-17 19:53:23 +00:00
_renderStatus(title, available) {
2018-05-13 04:31:01 +00:00
let className = available ? 'pull-right status-online' : 'pull-right status-offline';
return <React.Fragment>
2018-05-21 18:29:57 +00:00
{title}
2018-05-13 04:31:01 +00:00
<span className={className}></span>
</React.Fragment>;
}
render(){
2018-05-17 19:53:23 +00:00
return (
<div>
2018-05-22 13:49:22 +00:00
<TopNavbar accountUpdateHandler={(e) => this.setAccount(e)} />
2018-05-17 19:53:23 +00:00
<Tabs defaultActiveKey={1} id="uncontrolled-tab-example">
<Tab eventKey={0} title="VotingDapp">
<VotingDapp />
</Tab>
2018-05-17 19:53:23 +00:00
<Tab eventKey={1} title="TestToken">
<TestTokenUI />
</Tab>
<Tab eventKey={2} title="ERC20Token">
<ERC20TokenUI />
</Tab>
2018-05-21 21:42:23 +00:00
<Tab eventKey={3} title="ProposalManager">
<ProposalManager />
</Tab>
2018-05-17 19:53:23 +00:00
</Tabs>
</div>);
2018-05-13 04:31:01 +00:00
}
}
ReactDOM.render(<App></App>, document.getElementById('app'));