remove unused packages, remove slow getVisibility tooltip function
This commit is contained in:
parent
d43a40baf0
commit
b5d7a2b884
5 changed files with 18 additions and 168 deletions
|
@ -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",
|
||||
|
|
|
@ -241,6 +241,7 @@ class CategoryList extends PureComponent<Props, State> {
|
|||
)}
|
||||
{isCommunityTopBids && (
|
||||
<ToolTip
|
||||
direction="top"
|
||||
label={__("What's this?")}
|
||||
body={__(
|
||||
'Community Content is a public space where anyone can share content with the rest of the LBRY community. Bid on the names from "one" to "ten" to put your content here!'
|
||||
|
|
|
@ -29,63 +29,6 @@ class ToolTip extends React.PureComponent<Props, State> {
|
|||
};
|
||||
}
|
||||
|
||||
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<Props, State> {
|
|||
|
||||
return (
|
||||
<span
|
||||
onFocus={this.handleVisibility}
|
||||
onMouseOver={this.handleVisibility}
|
||||
className={classnames('tooltip', {
|
||||
'tooltip--label': label && !icon,
|
||||
'tooltip--icon': icon,
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import { createLogger } from 'redux-logger';
|
||||
import appReducer from 'redux/reducers/app';
|
||||
import availabilityReducer from 'redux/reducers/availability';
|
||||
import contentReducer from 'redux/reducers/content';
|
||||
|
@ -75,13 +74,6 @@ const reducers = combineReducers({
|
|||
const bulkThunk = createBulkThunkMiddleware();
|
||||
const middleware = [thunk, bulkThunk];
|
||||
|
||||
if (app.env === 'development') {
|
||||
const logger = createLogger({
|
||||
collapsed: true,
|
||||
});
|
||||
middleware.push(logger);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-underscore-dangle
|
||||
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
|
||||
|
||||
|
|
111
yarn.lock
111
yarn.lock
|
@ -2874,10 +2874,6 @@ dom-serializer@0, dom-serializer@~0.1.0:
|
|||
domelementtype "~1.1.1"
|
||||
entities "~1.1.1"
|
||||
|
||||
dom-walk@^0.1.0:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.1.tgz#672226dc74c8f799ad35307df936aba11acd6018"
|
||||
|
||||
domain-browser@^1.1.1:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda"
|
||||
|
@ -3969,18 +3965,6 @@ fbjs@^0.6.1:
|
|||
ua-parser-js "^0.7.9"
|
||||
whatwg-fetch "^0.9.0"
|
||||
|
||||
fbjs@^0.8.16:
|
||||
version "0.8.17"
|
||||
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd"
|
||||
dependencies:
|
||||
core-js "^1.0.0"
|
||||
isomorphic-fetch "^2.1.1"
|
||||
loose-envify "^1.0.0"
|
||||
object-assign "^4.1.0"
|
||||
promise "^7.1.1"
|
||||
setimmediate "^1.0.5"
|
||||
ua-parser-js "^0.7.18"
|
||||
|
||||
fd-slicer@~1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.0.1.tgz#8b5bcbd9ec327c5041bf9ab023fd6750f1177e65"
|
||||
|
@ -4185,12 +4169,6 @@ follow-redirects@^1.0.0:
|
|||
dependencies:
|
||||
debug "^3.1.0"
|
||||
|
||||
for-each@^0.3.2:
|
||||
version "0.3.3"
|
||||
resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e"
|
||||
dependencies:
|
||||
is-callable "^1.1.3"
|
||||
|
||||
for-in@^0.1.3:
|
||||
version "0.1.8"
|
||||
resolved "https://registry.yarnpkg.com/for-in/-/for-in-0.1.8.tgz#d8773908e31256109952b1fdb9b3fa867d2775e1"
|
||||
|
@ -4482,13 +4460,6 @@ global-dirs@^0.1.0:
|
|||
dependencies:
|
||||
ini "^1.3.4"
|
||||
|
||||
global@~4.3.0:
|
||||
version "4.3.2"
|
||||
resolved "https://registry.yarnpkg.com/global/-/global-4.3.2.tgz#e76989268a6c74c38908b1305b10fc0e394e9d0f"
|
||||
dependencies:
|
||||
min-document "^2.19.0"
|
||||
process "~0.5.1"
|
||||
|
||||
globals@^11.0.1, globals@^11.1.0:
|
||||
version "11.7.0"
|
||||
resolved "https://registry.yarnpkg.com/globals/-/globals-11.7.0.tgz#a583faa43055b1aca771914bf68258e2fc125673"
|
||||
|
@ -5244,10 +5215,6 @@ is-fullwidth-code-point@^2.0.0:
|
|||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
|
||||
|
||||
is-function@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.1.tgz#12cfb98b65b57dd3d193a3121f5f6e2f437602b5"
|
||||
|
||||
is-glob@^2.0.0, is-glob@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863"
|
||||
|
@ -5471,13 +5438,6 @@ isobject@^3.0.0, isobject@^3.0.1:
|
|||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"
|
||||
|
||||
isomorphic-fetch@^2.1.1:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9"
|
||||
dependencies:
|
||||
node-fetch "^1.0.1"
|
||||
whatwg-fetch ">=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"
|
||||
|
|
Loading…
Reference in a new issue