From 5ba120030a7641a0404252fb7d8b05fced8ede30 Mon Sep 17 00:00:00 2001 From: elijah Date: Mon, 7 Nov 2016 22:23:42 -0800 Subject: ui: add initial addressbook panel --- ui/app/components/addressbook/addressbook.less | 34 +++++++++++ ui/app/components/addressbook/index.js | 80 ++++++++++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 ui/app/components/addressbook/addressbook.less create mode 100644 ui/app/components/addressbook/index.js (limited to 'ui/app/components/addressbook') diff --git a/ui/app/components/addressbook/addressbook.less b/ui/app/components/addressbook/addressbook.less new file mode 100644 index 00000000..53e505b6 --- /dev/null +++ b/ui/app/components/addressbook/addressbook.less @@ -0,0 +1,34 @@ + +.body { + // background-color: #333; +} + +.darkBg { + background-color: #333; + padding: 8px; + position: absolute; + height: 100%; + width: 100%; + + display: -webkit-flex; + display: flex; + + .header { + .title { + font-weight: bold; + color: white; + display: inline-block; + //margin-left: 8px; + font-size: 120%; + h1 { + margin: 0px; + } + } + } +} + +.lightFg { + border-radius: 4px; + background-color: #fff; + padding: 15px; +} \ No newline at end of file diff --git a/ui/app/components/addressbook/index.js b/ui/app/components/addressbook/index.js new file mode 100644 index 00000000..74c119d3 --- /dev/null +++ b/ui/app/components/addressbook/index.js @@ -0,0 +1,80 @@ +// +// Interface to the key manager +// + + +import React from 'react' +import App from 'app' +import { ButtonToolbar, Button, Glyphicon, Alert } from 'react-bootstrap' + +import {VerticalLayout, Row} from 'components/layout' +import bitmask from 'lib/bitmask' +import './addressbook.less' + +export default class Addressbook extends React.Component { + + static get defaultProps() {return{ + account: null + }} + + constructor(props) { + super(props) + this.state = { + keys: null, + errorMsg: "" + } + this.close = this.close.bind(this) + } + + componentWillMount() { + bitmask.keys.list(true).then(keys => { + this.setState({keys: keys}) + }, error => { + this.setState({errorMsg: error}) + }) + } + + close() { + App.show('main', {initialAccount: this.props.account}) + } + + render() { + let alert = null + let keyList = null + + if (this.state.errorMsg) { + alert = ( + {this.state.errorMsg} + ) + } + + keyList = list of keys goes here + + let buttons = ( + + ) + + let page = ( + + +
+ {buttons} +
+
+ {this.props.account.address} +

Addressbook

+
+
+ + {alert} + {keyList} + +
+ ) + return page + } + +} -- cgit v1.2.3