diff options
author | Alexander Tseung <alextsg@gmail.com> | 2017-10-23 13:40:03 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2017-10-23 13:40:03 +0800 |
commit | 2c032e0df44a2d589aae62d3fc532df82441580b (patch) | |
tree | 7c6e3f79ac79f8ec99873cf9f51aafa1ec79ad8e /ui/app/components/tab-bar.js | |
parent | 8f3b762461ada222f82089e686a61183dd167428 (diff) | |
download | tangerine-wallet-browser-2c032e0df44a2d589aae62d3fc532df82441580b.tar tangerine-wallet-browser-2c032e0df44a2d589aae62d3fc532df82441580b.tar.gz tangerine-wallet-browser-2c032e0df44a2d589aae62d3fc532df82441580b.tar.bz2 tangerine-wallet-browser-2c032e0df44a2d589aae62d3fc532df82441580b.tar.lz tangerine-wallet-browser-2c032e0df44a2d589aae62d3fc532df82441580b.tar.xz tangerine-wallet-browser-2c032e0df44a2d589aae62d3fc532df82441580b.tar.zst tangerine-wallet-browser-2c032e0df44a2d589aae62d3fc532df82441580b.zip |
Update settings screen to new UI
Diffstat (limited to 'ui/app/components/tab-bar.js')
-rw-r--r-- | ui/app/components/tab-bar.js | 63 |
1 files changed, 33 insertions, 30 deletions
diff --git a/ui/app/components/tab-bar.js b/ui/app/components/tab-bar.js index bef444a48..fe4076ed0 100644 --- a/ui/app/components/tab-bar.js +++ b/ui/app/components/tab-bar.js @@ -1,37 +1,40 @@ -const Component = require('react').Component +const { Component } = require('react') const h = require('react-hyperscript') -const inherits = require('util').inherits +const classnames = require('classnames') -module.exports = TabBar +class TabBar extends Component { + constructor (props) { + super(props) + const { defaultTab, tabs } = props -inherits(TabBar, Component) -function TabBar () { - Component.call(this) -} + this.state = { + subview: defaultTab || tabs[0].key, + } + } -TabBar.prototype.render = function () { - const props = this.props - const state = this.state || {} - const { tabs = [], defaultTab, tabSelected } = props - const { subview = defaultTab } = state + render () { + const { tabs = [], tabSelected } = this.props + const { subview } = this.state - return ( - h('.flex-row.space-around.text-transform-uppercase', { - style: { - background: '#EBEBEB', - color: '#AEAEAE', - paddingTop: '4px', - minHeight: '30px', - }, - }, tabs.map((tab) => { - const { key, content } = tab - return h(subview === key ? '.activeForm' : '.inactiveForm.pointer', { - onClick: () => { - this.setState({ subview: key }) - tabSelected(key) - }, - }, content) - })) - ) + return ( + h('.tab-bar', {}, [ + tabs.map((tab) => { + const { key, content } = tab + return h('div', { + className: classnames('tab-bar__tab pointer', { + 'tab-bar__tab--active': subview === key, + }), + onClick: () => { + this.setState({ subview: key }) + tabSelected(key) + }, + key, + }, content) + }), + h('div.tab-bar__tab.tab-bar__grow-tab'), + ]) + ) + } } +module.exports = TabBar |