From b5d7a2b88416e9d0c79635151907544517915331 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Fri, 25 Jan 2019 13:10:10 -0500 Subject: [PATCH] remove unused packages, remove slow getVisibility tooltip function --- package.json | 7 +- src/renderer/component/categoryList/view.jsx | 1 + src/renderer/component/common/tooltip.jsx | 59 ---------- src/renderer/store.js | 8 -- yarn.lock | 111 +++---------------- 5 files changed, 18 insertions(+), 168 deletions(-) diff --git a/package.json b/package.json index 54f152200..f409843f1 100644 --- a/package.json +++ b/package.json @@ -62,8 +62,8 @@ "node-fetch": "^2.3.0", "qrcode.react": "^0.8.0", "rc-progress": "^2.0.6", - "react": "^16.3.0", - "react-dom": "^16.3.0", + "react": "^16.6.0", + "react-dom": "^16.6.0", "react-feather": "^1.0.8", "react-modal": "^3.1.7", "react-paginate": "^5.2.1", @@ -71,9 +71,7 @@ "react-redux": "^5.0.3", "react-simplemde-editor": "^3.6.16", "react-toggle": "^4.0.2", - "react-transition-group": "1.x", "redux": "^3.6.0", - "redux-logger": "^3.0.1", "redux-persist": "^4.8.0", "redux-persist-transform-compress": "^4.2.0", "redux-persist-transform-filter": "0.0.16", @@ -84,7 +82,6 @@ "render-media": "^3.1.0", "reselect": "^3.0.0", "semver": "^5.3.0", - "shapeshift.io": "^1.3.1", "source-map-support": "^0.5.4", "stream-to-blob-url": "^2.1.1", "three": "^0.93.0", diff --git a/src/renderer/component/categoryList/view.jsx b/src/renderer/component/categoryList/view.jsx index 035c27697..b85727ad5 100644 --- a/src/renderer/component/categoryList/view.jsx +++ b/src/renderer/component/categoryList/view.jsx @@ -241,6 +241,7 @@ class CategoryList extends PureComponent { )} {isCommunityTopBids && ( { }; } - componentDidMount() { - this.handleVisibility(); - } - - getVisibility = () => { - if (!this.tooltip) { - return; - } - - const node = this.tooltip; - const rect = node.getBoundingClientRect(); - - // Get parent-container - const viewport = document.getElementById('content'); - if (!viewport) { - throw Error('Document must contain parent div with #content'); - } - - const visibility = { - top: rect.top >= 0, - left: rect.left >= 0, - right: rect.right <= viewport.offsetWidth, - bottom: rect.bottom <= viewport.offsetHeight, - }; - - return visibility; - }; - - invertDirection = () => { - // Get current direction - const { direction } = this.state; - // Inverted directions - const directions = { - top: 'bottom', - left: 'right', - right: 'left', - bottom: 'top', - }; - - const inverted = directions[direction]; - - // Update direction - if (inverted) { - this.setState({ direction: inverted }); - } - }; - - handleVisibility = () => { - const { direction } = this.state; - const visibility = this.getVisibility(); - - // Invert direction if tooltip is outside viewport bounds - if (!visibility || !visibility[direction]) { - this.invertDirection(); - } - }; - tooltip: ?HTMLSpanElement; render() { @@ -98,8 +41,6 @@ class ToolTip extends React.PureComponent { return ( =0.10.0" - isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" @@ -6375,12 +6335,6 @@ mimic-response@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" -min-document@^2.19.0: - version "2.19.0" - resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685" - dependencies: - dom-walk "^0.1.0" - minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" @@ -6643,7 +6597,7 @@ node-emoji@^1.4.1: dependencies: lodash.toarray "^4.4.0" -node-fetch@^1.0.1, node-fetch@^1.3.3: +node-fetch@^1.3.3: version "1.7.3" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" dependencies: @@ -7199,13 +7153,6 @@ parse-glob@^3.0.4: is-extglob "^1.0.0" is-glob "^2.0.0" -parse-headers@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/parse-headers/-/parse-headers-2.0.1.tgz#6ae83a7aa25a9d9b700acc28698cd1f1ed7e9536" - dependencies: - for-each "^0.3.2" - trim "0.0.1" - parse-json@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" @@ -7726,10 +7673,6 @@ process@^0.11.0, process@^0.11.10: version "0.11.10" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" -process@~0.5.1: - version "0.5.2" - resolved "https://registry.yarnpkg.com/process/-/process-0.5.2.tgz#1638d8a8e34c2f440a91db95ab9aeb677fc185cf" - progress-stream@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/progress-stream/-/progress-stream-1.2.0.tgz#2cd3cfea33ba3a89c9c121ec3347abe9ab125f77" @@ -7948,14 +7891,14 @@ rc@^1.0.1, rc@^1.1.2, rc@^1.1.6, rc@^1.2.7: minimist "^1.2.0" strip-json-comments "~2.0.1" -react-dom@^16.3.0: - version "16.4.1" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.4.1.tgz#7f8b0223b3a5fbe205116c56deb85de32685dad6" +react-dom@^16.5.0: + version "16.7.0" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.7.0.tgz#a17b2a7ca89ee7390bc1ed5eb81783c7461748b8" dependencies: - fbjs "^0.8.16" loose-envify "^1.1.0" object-assign "^4.1.1" - prop-types "^15.6.0" + prop-types "^15.6.2" + scheduler "^0.12.0" react-feather@^1.0.8: version "1.1.1" @@ -8042,14 +7985,14 @@ react@^0.14.5: envify "^3.0.0" fbjs "^0.6.1" -react@^16.3.0: - version "16.6.1" - resolved "https://registry.yarnpkg.com/react/-/react-16.6.1.tgz#ee2aef4f0a09e494594882029821049772f915fe" +react@^16.5.0: + version "16.7.0" + resolved "https://registry.yarnpkg.com/react/-/react-16.7.0.tgz#b674ec396b0a5715873b350446f7ea0802ab6381" dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" prop-types "^15.6.2" - scheduler "^0.11.0" + scheduler "^0.12.0" read-config-file@3.1.0, read-config-file@^3.0.0: version "3.1.0" @@ -8415,7 +8358,7 @@ replace-ext@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb" -request@^2.45.0, request@^2.55.0: +request@^2.45.0: version "2.87.0" resolved "https://registry.yarnpkg.com/request/-/request-2.87.0.tgz#32f00235cd08d482b4d0d68db93a829c0ed5756e" dependencies: @@ -8640,9 +8583,9 @@ sax@~1.1.1: version "1.1.6" resolved "https://registry.yarnpkg.com/sax/-/sax-1.1.6.tgz#5d616be8a5e607d54e114afae55b7eaf2fcc3240" -scheduler@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.11.0.tgz#def1f1bfa6550cc57981a87106e65e8aea41a6b5" +scheduler@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.12.0.tgz#8ab17699939c0aedc5a196a657743c496538647b" dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" @@ -8780,7 +8723,7 @@ set-value@^2.0.0: is-plain-object "^2.0.3" split-string "^3.0.1" -setimmediate@^1.0.4, setimmediate@^1.0.5, setimmediate@~1.0.4: +setimmediate@^1.0.4, setimmediate@~1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" @@ -8811,13 +8754,6 @@ shallow-clone@^1.0.0: kind-of "^5.0.0" mixin-object "^2.0.1" -shapeshift.io@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/shapeshift.io/-/shapeshift.io-1.3.1.tgz#939f7d89e6a93fad4b556567d3fcdab45d5cc021" - dependencies: - request "^2.55.0" - xhr "^2.0.1" - shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" @@ -9731,10 +9667,6 @@ typo-js@*: version "1.0.3" resolved "https://registry.yarnpkg.com/typo-js/-/typo-js-1.0.3.tgz#54d8ebc7949f1a7810908b6002c6841526c99d5a" -ua-parser-js@^0.7.18: - version "0.7.19" - resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.19.tgz#94151be4c0a7fb1d001af7022fdaca4642659e4b" - ua-parser-js@^0.7.9: version "0.7.18" resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.18.tgz#a7bfd92f56edfb117083b69e31d2aa8882d4b1ed" @@ -10319,10 +10251,6 @@ websocket-extensions@>=0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.3.tgz#5d2ff22977003ec687a4b87073dfbbac146ccf29" -whatwg-fetch@>=0.10.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb" - whatwg-fetch@^0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-0.9.0.tgz#0e3684c6cb9995b43efc9df03e4c365d95fd9cc0" @@ -10424,15 +10352,6 @@ xdg-basedir@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" -xhr@^2.0.1: - version "2.5.0" - resolved "https://registry.yarnpkg.com/xhr/-/xhr-2.5.0.tgz#bed8d1676d5ca36108667692b74b316c496e49dd" - dependencies: - global "~4.3.0" - is-function "^1.0.1" - parse-headers "^2.0.0" - xtend "^4.0.0" - xml2js@0.4.17: version "0.4.17" resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.17.tgz#17be93eaae3f3b779359c795b419705a8817e868"