diff --git a/app/components/acclist.js b/app/components/acclist.js new file mode 100644 index 0000000..12fbe2b --- /dev/null +++ b/app/components/acclist.js @@ -0,0 +1,47 @@ +import EmbarkJS from 'Embark/EmbarkJS'; +import React from 'react'; +import { Nav, MenuItem , NavDropdown} from 'react-bootstrap'; +import web3 from "Embark/web3" + +class AccList extends React.Component { + + constructor(props) { + super(props); + this.state = { + accounts: [] + } + __embarkContext.execWhenReady(() => { + this.loadAccs() + }); + } + + loadAccs() { + let result = web3.eth.getAccounts().then((accounts) => { + console.log(accounts); + this.setState({accounts: accounts}); + }) + console.log(result) + } + render(){ + var len = this.state.accounts.length; + var fulllist = this.state.accounts.map( + function(name, index){ + return {name}; + } + ) + return ( + + + + {fulllist} + + this.loadAccs()} >Update + + + + ) + } + + } + + export default AccList; \ No newline at end of file diff --git a/app/components/topnavbar.js b/app/components/topnavbar.js new file mode 100644 index 0000000..f24e228 --- /dev/null +++ b/app/components/topnavbar.js @@ -0,0 +1,32 @@ +import EmbarkJS from 'Embark/EmbarkJS'; +import React from 'react'; +import { Navbar, NavItem, Nav, MenuItem , NavDropdown} from 'react-bootstrap'; +import AccList from './acclist'; +class TopNavbar extends React.Component { + + constructor(props) { + super(props); + this.state = { + + } + + } + + render(){ + + return ( + + + + + Status.im Demo + + + + + + ); + } + } + + export default TopNavbar; \ No newline at end of file diff --git a/app/dapp.css b/app/dapp.css index 49f1976..b291767 100644 --- a/app/dapp.css +++ b/app/dapp.css @@ -1,8 +1,3 @@ - -div { - margin: 15px; -} - .logs { background-color: black; font-size: 14px; diff --git a/app/dapp.js b/app/dapp.js index 6df03e3..a0744b3 100644 --- a/app/dapp.js +++ b/app/dapp.js @@ -3,6 +3,7 @@ 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'; @@ -23,7 +24,7 @@ class App extends React.Component { } - _renderStatus(title, available){ + _renderStatus(title, available) { let className = available ? 'pull-right status-online' : 'pull-right status-offline'; return {title} @@ -32,16 +33,18 @@ class App extends React.Component { } render(){ - return (Status.im Contracts - - - - - - - - - ); + return ( + + + + + + + + + + + ); } }