liquid-funding/app/dapp.js

36 lines
773 B
JavaScript
Raw Normal View History

2018-11-28 16:12:50 +00:00
import React from 'react';
import EmbarkJS from 'Embark/EmbarkJS';
2018-11-29 16:45:57 +00:00
import LPVault from 'Embark/contracts/LPVault';
import LiquidPledgingMock from 'Embark/contracts/LiquidPledgingMock';
2018-11-28 16:12:50 +00:00
import web3 from "Embark/web3";
2018-11-29 20:52:24 +00:00
import Giving from './components/Giving';
2018-11-28 16:12:50 +00:00
const { getNetworkType } = web3.eth.net;
class App extends React.Component {
constructor(props) {
super(props)
}
state = { admin: false };
componentDidMount(){
2018-11-29 16:45:57 +00:00
EmbarkJS.onReady(async (err) => {
2018-11-28 16:12:50 +00:00
getNetworkType().then(network => {
2018-11-29 20:52:24 +00:00
//TODO add window.ethereum.enable();
2018-11-28 16:12:50 +00:00
const { environment } = EmbarkJS
this.setState({ network, environment })
});
});
}
render() {
return (
<div>
2018-11-29 20:52:24 +00:00
<Giving />
</div>
2018-11-28 16:12:50 +00:00
)
}
}
export default App;