2018-05-02 20:51:30 +00:00
|
|
|
import React from 'react';
|
|
|
|
import ReactDOM from 'react-dom';
|
|
|
|
import { Tabs, Tab } from 'react-bootstrap';
|
|
|
|
|
|
|
|
import EmbarkJS from 'Embark/EmbarkJS';
|
|
|
|
import RND from 'Embark/contracts/RND';
|
2018-05-03 14:59:12 +00:00
|
|
|
import IdentityGasRelay from 'Embark/contracts/IdentityGasRelay';
|
|
|
|
|
|
|
|
import CallGasRelayed from './components/callgasrelayed';
|
|
|
|
import ApproveAndCallGasRelayed from './components/approveandcallgasrelayed';
|
2018-05-02 20:51:30 +00:00
|
|
|
|
|
|
|
import './relayer-test.css';
|
|
|
|
|
|
|
|
class App extends React.Component {
|
|
|
|
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
2018-05-03 14:59:12 +00:00
|
|
|
|
|
|
|
window['RND'] = RND;
|
|
|
|
window['IdentityGasRelay'] = IdentityGasRelay;
|
2018-05-02 20:51:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
_renderStatus(title, available){
|
|
|
|
let className = available ? 'pull-right status-online' : 'pull-right status-offline';
|
|
|
|
return <React.Fragment>
|
|
|
|
{title}
|
|
|
|
<span className={className}></span>
|
|
|
|
</React.Fragment>;
|
|
|
|
}
|
|
|
|
|
|
|
|
render(){
|
|
|
|
return (<div><h3>IdentityGasRelay - Usage Example</h3>
|
|
|
|
<Tabs defaultActiveKey={1} id="uncontrolled-tab-example">
|
|
|
|
<Tab eventKey={1} title="callGasRelayed">
|
2018-05-03 14:59:12 +00:00
|
|
|
<CallGasRelayed IdentityGasRelay={IdentityGasRelay} RND={RND} web3={web3} />
|
|
|
|
</Tab>
|
|
|
|
<Tab eventKey={2} title="approveAndCallGasRelayed">
|
|
|
|
<ApproveAndCallGasRelayed IdentityGasRelay={IdentityGasRelay} RND={RND} web3={web3} />
|
2018-05-02 20:51:30 +00:00
|
|
|
</Tab>
|
|
|
|
</Tabs>
|
|
|
|
</div>);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ReactDOM.render(<App></App>, document.getElementById('app'));
|