Merging changes
This commit is contained in:
commit
6e6247593c
|
@ -0,0 +1,34 @@
|
|||
import React, { Fragment } from 'react';
|
||||
import { Tabs, Tab } from 'react-bootstrap';
|
||||
import 'bootstrap/dist/css/bootstrap.css';
|
||||
import TopNavbar from './topnavbar';
|
||||
import TestTokenUI from './testtoken';
|
||||
import ERC20TokenUI from './erc20token';
|
||||
import ProposalManager from './proposal-manager/proposal-manager'
|
||||
import VotingDapp from './voting-dapp/voting-dapp';
|
||||
import SNTUI from './snt-ui';
|
||||
|
||||
export default ({ setAccount }) => {
|
||||
return (
|
||||
<div class="container">
|
||||
<TopNavbar accountUpdateHandler={(e) => setAccount(e)} />
|
||||
<Tabs defaultActiveKey={0} id="uncontrolled-tab-example">
|
||||
<Tab eventKey={0} title="VotingDapp">
|
||||
<VotingDapp />
|
||||
</Tab>
|
||||
<Tab eventKey={1} title="ProposalManager">
|
||||
<ProposalManager />
|
||||
</Tab>
|
||||
<Tab eventKey={2} title="SNT Token">
|
||||
<SNTUI />
|
||||
</Tab>
|
||||
<Tab eventKey={3} title="TestToken">
|
||||
<TestTokenUI />
|
||||
</Tab>
|
||||
<Tab eventKey={4} title="ERC20Token">
|
||||
<ERC20TokenUI />
|
||||
</Tab>
|
||||
</Tabs>
|
||||
</div>
|
||||
)
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
import React, { Fragment } from 'react';
|
||||
import CssBaseline from '@material-ui/core/CssBaseline';
|
||||
import 'typeface-roboto';
|
||||
import AppBar from './standard/AppBar';
|
||||
|
||||
export default ({ toggleAdmin }) => (
|
||||
<Fragment>
|
||||
<CssBaseline />
|
||||
<AppBar toggleAdmin={toggleAdmin} />
|
||||
</Fragment>
|
||||
)
|
|
@ -0,0 +1,48 @@
|
|||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { withStyles } from '@material-ui/core/styles';
|
||||
import AppBar from '@material-ui/core/AppBar';
|
||||
import Toolbar from '@material-ui/core/Toolbar';
|
||||
import Typography from '@material-ui/core/Typography';
|
||||
import Button from '@material-ui/core/Button';
|
||||
import IconButton from '@material-ui/core/IconButton';
|
||||
import MenuIcon from '@material-ui/icons/Menu';
|
||||
|
||||
const styles = {
|
||||
root: {
|
||||
flexGrow: 1,
|
||||
fontSize: '16px'
|
||||
},
|
||||
flex: {
|
||||
flex: 1,
|
||||
},
|
||||
menuButton: {
|
||||
marginLeft: -12,
|
||||
marginRight: 20,
|
||||
},
|
||||
};
|
||||
|
||||
function ButtonAppBar(props) {
|
||||
const { classes, toggleAdmin } = props;
|
||||
return (
|
||||
<div className={classes.root} >
|
||||
<AppBar position="static">
|
||||
<Toolbar>
|
||||
<IconButton className={classes.menuButton} color="inherit" aria-label="Menu">
|
||||
<MenuIcon onClick={toggleAdmin} />
|
||||
</IconButton>
|
||||
<Typography variant="display1" color="inherit" className={classes.flex}>
|
||||
What should we build next?
|
||||
</Typography>
|
||||
<Button color="inherit" style={{ fontSize: '16px' }}>Add Proposal</Button>
|
||||
</Toolbar>
|
||||
</AppBar>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
ButtonAppBar.propTypes = {
|
||||
classes: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
export default withStyles(styles)(ButtonAppBar);
|
43
app/dapp.js
43
app/dapp.js
|
@ -1,15 +1,9 @@
|
|||
import React from 'react';
|
||||
import React, { Fragment } from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { Tabs, Tab } from 'react-bootstrap';
|
||||
|
||||
import EmbarkJS from 'Embark/EmbarkJS';
|
||||
import TopNavbar from './components/topnavbar';
|
||||
import TestTokenUI from './components/testtoken';
|
||||
import ERC20TokenUI from './components/erc20token';
|
||||
import ProposalManager from './components/proposal-manager/proposal-manager'
|
||||
import VotingDapp from './components/voting-dapp/voting-dapp';
|
||||
import SNTUI from './components/snt-ui';
|
||||
|
||||
import AdminView from './components/AdminView';
|
||||
import Voting from './components/Voting';
|
||||
import SNT from 'Embark/contracts/SNT';
|
||||
window['SNT'] = SNT;
|
||||
|
||||
|
@ -20,6 +14,7 @@ class App extends React.Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
state = { admin: false };
|
||||
|
||||
componentDidMount(){
|
||||
__embarkContext.execWhenReady(() => {
|
||||
|
@ -32,34 +27,20 @@ class App extends React.Component {
|
|||
|
||||
_renderStatus(title, available) {
|
||||
let className = available ? 'pull-right status-online' : 'pull-right status-offline';
|
||||
return <React.Fragment>
|
||||
return <Fragment>
|
||||
{title}
|
||||
<span className={className}></span>
|
||||
</React.Fragment>;
|
||||
</Fragment>;
|
||||
}
|
||||
|
||||
render(){
|
||||
const { admin } = this.state;
|
||||
const toggleAdmin = () => this.setState({ admin: true });
|
||||
return (
|
||||
<div>
|
||||
<TopNavbar accountUpdateHandler={(e) => this.setAccount(e)} />
|
||||
<Tabs defaultActiveKey={0} id="uncontrolled-tab-example">
|
||||
<Tab eventKey={0} title="VotingDapp">
|
||||
<VotingDapp />
|
||||
</Tab>
|
||||
<Tab eventKey={1} title="ProposalManager">
|
||||
<ProposalManager />
|
||||
</Tab>
|
||||
<Tab eventKey={2} title="SNT Token">
|
||||
<SNTUI />
|
||||
</Tab>
|
||||
<Tab eventKey={3} title="TestToken">
|
||||
<TestTokenUI />
|
||||
</Tab>
|
||||
<Tab eventKey={4} title="ERC20Token">
|
||||
<ERC20TokenUI />
|
||||
</Tab>
|
||||
</Tabs>
|
||||
</div>);
|
||||
<Fragment>
|
||||
{admin ? <AdminView setAccount={this.setAccount} /> : <Voting toggleAdmin={toggleAdmin} />}
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Status.im - Contracts</title>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
|
||||
</head>
|
||||
<body class="container">
|
||||
<body>
|
||||
<div id="app">
|
||||
</div>
|
||||
<script src="js/dapp.js"></script>
|
||||
|
|
|
@ -17,9 +17,12 @@
|
|||
},
|
||||
"homepage": "https://github.com/status-im/contracts#readme",
|
||||
"dependencies": {
|
||||
"@material-ui/core": "^1.3.0",
|
||||
"@material-ui/icons": "^1.1.0",
|
||||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
||||
"babel-preset-stage-2": "^6.24.1",
|
||||
"bignumber.js": "^5.0.0",
|
||||
"bootstrap": "^3.3.7",
|
||||
"formik": "^0.11.11",
|
||||
"jquery": "^3.3.1",
|
||||
"lodash": "^4.17.10",
|
||||
|
@ -28,6 +31,7 @@
|
|||
"react-bootstrap": "^0.32.1",
|
||||
"react-dom": "^16.3.2",
|
||||
"react-toggle": "^4.0.2",
|
||||
"rlp": "^2.0.0"
|
||||
"rlp": "^2.0.0",
|
||||
"typeface-roboto": "0.0.54"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue