diff --git a/package.json b/package.json index 49ae1ada2..ecd5f3f66 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,6 @@ "@hot-loader/react-dom": "16.8", "@lbry/color": "^1.0.2", "@lbry/components": "^2.3.3", - "@reach/router": "^1.2.1", "@types/three": "^0.93.1", "async-exit-hook": "^2.0.1", "babel-eslint": "^10.0.1", @@ -70,6 +69,7 @@ "chalk": "^2.4.2", "classnames": "^2.2.5", "codemirror": "^5.39.2", + "connected-react-router": "^6.3.2", "copy-webpack-plugin": "^4.6.0", "country-data": "^0.0.31", "cross-env": "^5.2.0", @@ -104,6 +104,7 @@ "flow-typed": "^2.3.0", "formik": "^0.10.4", "hast-util-sanitize": "^1.1.2", + "history": "^4.9.0", "husky": "^0.14.3", "json-loader": "^0.5.4", "lbry-format": "https://github.com/lbryio/lbry-format.git", @@ -134,7 +135,8 @@ "react-modal": "^3.1.7", "react-paginate": "^5.2.1", "react-pose": "^4.0.5", - "react-redux": "^5.0.3", + "react-redux": "^6.0.1", + "react-router-dom": "^5.0.0", "react-simplemde-editor": "^4.0.0", "react-toggle": "^4.0.2", "react-virtualized": "^9.21.0", diff --git a/src/ui/analytics.js b/src/ui/analytics.js index 58e7581cc..57c9590df 100644 --- a/src/ui/analytics.js +++ b/src/ui/analytics.js @@ -1,7 +1,6 @@ // @flow import { Lbryio } from 'lbryinc'; import ReactGA from 'react-ga'; -import { globalHistory } from '@reach/router'; type Analytics = { pageView: string => void, @@ -15,7 +14,7 @@ let analyticsEnabled: boolean = true; const analytics: Analytics = { pageView: path => { if (analyticsEnabled) { - ReactGA.pageview(path); + // ReactGA.pageview(path); } }, setUser: user => { @@ -72,19 +71,19 @@ const analytics: Analytics = { // Initialize google analytics // Set `debug: true` for debug info -ReactGA.initialize('UA-60403362-12', { - gaOptions: { name: IS_WEB ? 'web' : 'desktop' }, - testMode: process.env.NODE_ENV !== 'production', -}); +// ReactGA.initialize('UA-60403362-12', { +// gaOptions: { name: IS_WEB ? 'web' : 'desktop' }, +// testMode: process.env.NODE_ENV !== 'production', +// }); // Manually call the first page view // Reach Router doesn't include this on `history.listen` -analytics.pageView(window.location.pathname + window.location.search); +// analytics.pageView(window.location.pathname + window.location.search); // Listen for url changes and report // This will include search queries/filter options -globalHistory.listen(({ location }) => - analytics.pageView(window.location.pathname + window.location.search) -); +// globalHistory.listen(({ location }) => +// analytics.pageView(window.location.pathname + window.location.search) +// ); export default analytics; diff --git a/src/ui/app.js b/src/ui/app.js index f82a53307..165b0b369 100644 --- a/src/ui/app.js +++ b/src/ui/app.js @@ -1,4 +1,4 @@ -import store from 'store'; +import { store } from 'store'; const env = process.env.NODE_ENV || 'production'; diff --git a/src/ui/component/app/view.jsx b/src/ui/component/app/view.jsx index 74be7a2d6..0494c9534 100644 --- a/src/ui/component/app/view.jsx +++ b/src/ui/component/app/view.jsx @@ -3,7 +3,6 @@ import React from 'react'; import Router from 'component/router/index'; import ModalRouter from 'modal/modalRouter'; import ReactModal from 'react-modal'; -import throttle from 'util/throttle'; import SideBar from 'component/sideBar'; import Header from 'component/header'; import { openContextMenu } from 'util/context-menu'; diff --git a/src/ui/component/button/view.jsx b/src/ui/component/button/view.jsx index 8bee0261b..9ca8a04ef 100644 --- a/src/ui/component/button/view.jsx +++ b/src/ui/component/button/view.jsx @@ -2,7 +2,7 @@ import * as React from 'react'; import Icon from 'component/common/icon'; import classnames from 'classnames'; -import { Link } from '@reach/router'; +import { NavLink } from 'react-router-dom'; import { formatLbryUriForWeb } from 'util/uri'; import { OutboundLink } from 'react-ga'; @@ -109,19 +109,16 @@ class Button extends React.PureComponent { } return path ? ( - e.stopPropagation()} - getProps={({ isCurrent, isPartiallyCurrent }) => ({ - className: - (path === '/' ? isCurrent : isPartiallyCurrent) && activeClass - ? `${combinedClassName} ${activeClass}` - : combinedClassName, - })} + className={combinedClassName} + activeClassName={activeClass} > {content} - + ) : (