diff options
author | Dan <danjm.com@gmail.com> | 2017-08-26 00:18:52 +0800 |
---|---|---|
committer | Dan <danjm.com@gmail.com> | 2017-08-26 03:34:23 +0800 |
commit | e56b8c5055a19ccfb88ef71f4cef13fb6d05a54a (patch) | |
tree | 11350939241b964775f5a1a46e08e171a303c3ab /ui/app/components/new-tooltip.js | |
parent | 5677fdaf68ff28b9d9b4b27be1737101489f3861 (diff) | |
download | tangerine-wallet-browser-e56b8c5055a19ccfb88ef71f4cef13fb6d05a54a.tar.gz tangerine-wallet-browser-e56b8c5055a19ccfb88ef71f4cef13fb6d05a54a.tar.zst tangerine-wallet-browser-e56b8c5055a19ccfb88ef71f4cef13fb6d05a54a.zip |
Refactor tooltip to remove external lib; tooltip now updating gas fee in parent.
Diffstat (limited to 'ui/app/components/new-tooltip.js')
-rw-r--r-- | ui/app/components/new-tooltip.js | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/ui/app/components/new-tooltip.js b/ui/app/components/new-tooltip.js deleted file mode 100644 index e6103dc95..000000000 --- a/ui/app/components/new-tooltip.js +++ /dev/null @@ -1,66 +0,0 @@ -const Component = require('react').Component -const h = require('react-hyperscript') -const inherits = require('util').inherits -const findDOMNode = require('react-dom').findDOMNode -const ReactTooltip = require('react-tooltip') - -module.exports = NewTooltip - -inherits(NewTooltip, Component) -function NewTooltip () { - Component.call(this) - this.state = { - tooltipNode: null, - tooltipBase: null, - } - - // this.pageClick = this.pageClick.bind(this) -} - -// NewTooltip.prototype.pageClick = function (e) { -// // event.preventDefault(); -// const tooltipNode = this.state.tooltipNode -// console.log(`e.target`, e.target); -// console.log(`tooltipNode.contains(e.target)`, tooltipNode.contains(e.target)); -// }, - -NewTooltip.prototype.componentDidMount = function () { - const tooltipNode = findDOMNode(this); - const tooltipBase = findDOMNode(this.refs.tester) - - this.setState({ tooltipBase, tooltipNode }) -} - -NewTooltip.prototype.componentDidUpdate = function () { - const { show } = this.props - const tooltipBase = this.state.tooltipBase - const tooltipNode = this.state.tooltipNode - - if (show) { - ReactTooltip.show(tooltipBase) - } - else { - ReactTooltip.hide(tooltipBase) - } -} - -NewTooltip.prototype.render = function () { - const props = this.props - const { position, title, children } = props - - return h('div', {}, [ - h('div', { - 'data-tip': 'test', - 'data-for': 'something', - 'ref': 'tester', - }), - h(ReactTooltip, { - place: position || 'top', - effect: 'solid', - id: 'something', - className: 'send-tooltip', - type: 'light', - }, children), - ]) - -} |