diff options
author | sdtsui <szehungdanieltsui@gmail.com> | 2017-07-14 15:53:54 +0800 |
---|---|---|
committer | sdtsui <szehungdanieltsui@gmail.com> | 2017-07-18 20:31:39 +0800 |
commit | 433fb4d24201d30eb84350bb1bd649f5bb22ad92 (patch) | |
tree | f514702cc6324db514256736b14ed6eb5e20ec09 /ui/responsive/app/components | |
parent | d01b5c927d9ae874cc8a7d68fbd1f8649dbba291 (diff) | |
download | tangerine-wallet-browser-433fb4d24201d30eb84350bb1bd649f5bb22ad92.tar.gz tangerine-wallet-browser-433fb4d24201d30eb84350bb1bd649f5bb22ad92.tar.zst tangerine-wallet-browser-433fb4d24201d30eb84350bb1bd649f5bb22ad92.zip |
Cleanup
Fix lint error breaking gulp build
Add presentational options menus
Diffstat (limited to 'ui/responsive/app/components')
-rw-r--r-- | ui/responsive/app/components/account-options-menus.js | 77 | ||||
-rw-r--r-- | ui/responsive/app/components/editable-label.js | 7 |
2 files changed, 82 insertions, 2 deletions
diff --git a/ui/responsive/app/components/account-options-menus.js b/ui/responsive/app/components/account-options-menus.js new file mode 100644 index 000000000..acaf53c9e --- /dev/null +++ b/ui/responsive/app/components/account-options-menus.js @@ -0,0 +1,77 @@ +const Component = require('react').Component; +const PropTypes = require('react').PropTypes; +const h = require('react-hyperscript'); +const Dropdown = require('./dropdown').Dropdown; +const DropdownMenuItem = require('./dropdown').DropdownMenuItem; + +class AccountOptionsMenus extends Component { + constructor(props) { + super(props); + this.state = { + overflowMenuActive: false, + switchingMenuActive: false, + }; + console.log("state:", this.state); + } + + render() { + console.log("RENDERING AcountOptionsMenus"); + return h( + 'span', + { + style: this.props.style, + }, + [ + h( + 'i.fa.fa-angle-down', + { + onClick: (event) => { + event.stopPropagation(); + this.setState({ switchingMenuActive: !this.state.switchingMenuActive }) + } + }, + [ + h( + Dropdown, + { + isOpen: this.state.switchingMenuActive, + onClickOutside: () => { this.setState({ switchingMenuActive: false})} + }, + [ + h(DropdownMenuItem, { + }, 'Settings'), + ] + ) + ], + ), + h( + 'i.fa.fa-ellipsis-h', + { + style: { 'marginLeft': '10px'}, + onClick: () => { this.setState({ switchingMenuActive: !this.state.switchingMenuActive }) } + }, + [ + h( + Dropdown, + { + isOpen: this.state.overflowMenuActive, + onClickOutside: (event) => { + event.stopPropagation(); + this.setState({ overflowMenuActive: false}) + } + }, + [ + h(DropdownMenuItem, { + }, 'Settings'), + ] + ) + ] + ) + ] + ) + } +} + +module.exports = { + AccountOptionsMenus, +};
\ No newline at end of file diff --git a/ui/responsive/app/components/editable-label.js b/ui/responsive/app/components/editable-label.js index 41936f5e0..43841bdd8 100644 --- a/ui/responsive/app/components/editable-label.js +++ b/ui/responsive/app/components/editable-label.js @@ -30,12 +30,15 @@ EditableLabel.prototype.render = function () { } else { return h('div.name-label', { onClick: (event) => { - this.setState({ isEditingLabel: true }) + if (event.target.getAttribute('name') === 'edit') { + this.setState({ isEditingLabel: true }) + } }, }, this.props.children) } } - +// class = edit-text +// name = edit EditableLabel.prototype.saveIfEnter = function (event) { if (event.key === 'Enter') { this.saveText() |