diff options
author | Thomas Huang <tmashuang@users.noreply.github.com> | 2019-04-02 09:03:54 +0800 |
---|---|---|
committer | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2019-04-02 09:03:54 +0800 |
commit | a46ec83c9b258a3aed65e1ef08769300c01ca13b (patch) | |
tree | a48f7ddb8635ffbb024ff755d1865686c8a0ab27 /ui/app/components | |
parent | 4055dc3475cb743e540766a8a8c704bb2b807502 (diff) | |
download | tangerine-wallet-browser-a46ec83c9b258a3aed65e1ef08769300c01ca13b.tar tangerine-wallet-browser-a46ec83c9b258a3aed65e1ef08769300c01ca13b.tar.gz tangerine-wallet-browser-a46ec83c9b258a3aed65e1ef08769300c01ca13b.tar.bz2 tangerine-wallet-browser-a46ec83c9b258a3aed65e1ef08769300c01ca13b.tar.lz tangerine-wallet-browser-a46ec83c9b258a3aed65e1ef08769300c01ca13b.tar.xz tangerine-wallet-browser-a46ec83c9b258a3aed65e1ef08769300c01ca13b.tar.zst tangerine-wallet-browser-a46ec83c9b258a3aed65e1ef08769300c01ca13b.zip |
Remove NoticeController (#6382)
Diffstat (limited to 'ui/app/components')
-rw-r--r-- | ui/app/components/app/notice.js | 138 | ||||
-rw-r--r-- | ui/app/components/app/send/tests/send-selectors-test-data.js | 1 |
2 files changed, 0 insertions, 139 deletions
diff --git a/ui/app/components/app/notice.js b/ui/app/components/app/notice.js deleted file mode 100644 index bb7e0814c..000000000 --- a/ui/app/components/app/notice.js +++ /dev/null @@ -1,138 +0,0 @@ -const inherits = require('util').inherits -const Component = require('react').Component -const PropTypes = require('prop-types') -const h = require('react-hyperscript') -const ReactMarkdown = require('react-markdown') -const linker = require('extension-link-enabler') -const findDOMNode = require('react-dom').findDOMNode -const connect = require('react-redux').connect - -Notice.contextTypes = { - t: PropTypes.func, -} - -module.exports = connect()(Notice) - - -inherits(Notice, Component) -function Notice () { - Component.call(this) -} - -Notice.prototype.render = function () { - const { notice, onConfirm } = this.props - const { title, date, body } = notice - const state = this.state || { disclaimerDisabled: true } - const disabled = state.disclaimerDisabled - - return ( - h('.flex-column.flex-center.flex-grow', { - style: { - width: '100%', - }, - }, [ - h('h3.flex-center.text-transform-uppercase.terms-header', { - style: { - background: '#EBEBEB', - color: '#AEAEAE', - width: '100%', - fontSize: '20px', - textAlign: 'center', - padding: 6, - }, - }, [ - title, - ]), - - h('h5.flex-center.text-transform-uppercase.terms-header', { - style: { - background: '#EBEBEB', - color: '#AEAEAE', - marginBottom: 24, - width: '100%', - fontSize: '20px', - textAlign: 'center', - padding: 6, - }, - }, [ - date, - ]), - - h('style', ` - - .markdown { - overflow-x: hidden; - } - - .markdown h1, .markdown h2, .markdown h3 { - margin: 10px 0; - font-weight: bold; - } - - .markdown strong { - font-weight: bold; - } - .markdown em { - font-style: italic; - } - - .markdown p { - margin: 10px 0; - } - - .markdown a { - color: #df6b0e; - } - - `), - - h('div.markdown', { - onScroll: (e) => { - var object = e.currentTarget - if (object.offsetHeight + object.scrollTop + 100 >= object.scrollHeight) { - this.setState({disclaimerDisabled: false}) - } - }, - style: { - background: 'rgb(235, 235, 235)', - height: '310px', - padding: '6px', - width: '90%', - overflowY: 'scroll', - scroll: 'auto', - }, - }, [ - h(ReactMarkdown, { - className: 'notice-box', - source: body, - skipHtml: true, - }), - ]), - - h('button.primary', { - disabled, - onClick: () => { - this.setState({disclaimerDisabled: true}, () => onConfirm()) - }, - style: { - marginTop: '18px', - }, - }, this.context.t('accept')), - ]) - ) -} - -Notice.prototype.componentDidMount = function () { - // eslint-disable-next-line react/no-find-dom-node - var node = findDOMNode(this) - linker.setupListener(node) - if (document.getElementsByClassName('notice-box')[0].clientHeight < 310) { - this.setState({disclaimerDisabled: false}) - } -} - -Notice.prototype.componentWillUnmount = function () { - // eslint-disable-next-line react/no-find-dom-node - var node = findDOMNode(this) - linker.teardownListener(node) -} diff --git a/ui/app/components/app/send/tests/send-selectors-test-data.js b/ui/app/components/app/send/tests/send-selectors-test-data.js index d43d7c650..cff26a191 100644 --- a/ui/app/components/app/send/tests/send-selectors-test-data.js +++ b/ui/app/components/app/send/tests/send-selectors-test-data.js @@ -28,7 +28,6 @@ module.exports = { 'conversionRate': 1200.88200327, 'conversionDate': 1489013762, 'nativeCurrency': 'ETH', - 'noActiveNotices': true, 'frequentRpcList': [], 'network': '3', 'accounts': { |