aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/tab-bar.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-01-18 05:58:54 +0800
committerDan Finlay <dan@danfinlay.com>2017-01-18 05:58:54 +0800
commit958cbfbde44c201cf71f5dfcb7b1748bb43e597f (patch)
tree17949bcdd27172541ff374d8b8bf44ccd570af92 /ui/app/components/tab-bar.js
parent77bd010543855fafe21ac37e282bc8137ef7a7d8 (diff)
parentb3cb675a8bd406bd16aa74ff209032075f9b31d7 (diff)
downloadtangerine-wallet-browser-958cbfbde44c201cf71f5dfcb7b1748bb43e597f.tar
tangerine-wallet-browser-958cbfbde44c201cf71f5dfcb7b1748bb43e597f.tar.gz
tangerine-wallet-browser-958cbfbde44c201cf71f5dfcb7b1748bb43e597f.tar.bz2
tangerine-wallet-browser-958cbfbde44c201cf71f5dfcb7b1748bb43e597f.tar.lz
tangerine-wallet-browser-958cbfbde44c201cf71f5dfcb7b1748bb43e597f.tar.xz
tangerine-wallet-browser-958cbfbde44c201cf71f5dfcb7b1748bb43e597f.tar.zst
tangerine-wallet-browser-958cbfbde44c201cf71f5dfcb7b1748bb43e597f.zip
Merge branch 'i328-MultiVault-v1' into i715-AddImportMenu
Diffstat (limited to 'ui/app/components/tab-bar.js')
-rw-r--r--ui/app/components/tab-bar.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/ui/app/components/tab-bar.js b/ui/app/components/tab-bar.js
new file mode 100644
index 000000000..65078e0a4
--- /dev/null
+++ b/ui/app/components/tab-bar.js
@@ -0,0 +1,35 @@
+const Component = require('react').Component
+const h = require('react-hyperscript')
+const inherits = require('util').inherits
+
+module.exports = TabBar
+
+inherits(TabBar, Component)
+function TabBar () {
+ Component.call(this)
+}
+
+TabBar.prototype.render = function () {
+ const props = this.props
+ const state = this.state || {}
+ const { tabs = [], defaultTab, tabSelected } = props
+ const { subview = defaultTab } = state
+
+ return (
+ h('.flex-row.space-around.text-transform-uppercase', {
+ style: {
+ background: '#EBEBEB',
+ color: '#AEAEAE',
+ paddingTop: '4px',
+ },
+ }, tabs.map((tab) => {
+ const { key, content } = tab
+ return h(subview === key ? '.activeForm' : '.inactiveForm.pointer', {
+ onClick: () => {
+ this.setState({ subview: key })
+ tabSelected(key)
+ },
+ }, content)
+ }))
+ )
+}