diff --git a/client/package-lock.json b/client/package-lock.json index 58da1b76fb..d88e331e71 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -16956,15 +16956,6 @@ } } }, - "react-scroll": { - "version": "1.7.14", - "resolved": "https://registry.npmjs.org/react-scroll/-/react-scroll-1.7.14.tgz", - "integrity": "sha512-zQ2/8+TaEBctA9RSQspP5GWMffA6g7u+AB9gMWB42btZZTBcGEyomvxnm52UVVELjqXOpD9U1/tHhVTNXyntbQ==", - "requires": { - "lodash.throttle": "^4.1.1", - "prop-types": "^15.5.8" - } - }, "react-side-effect": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/react-side-effect/-/react-side-effect-1.1.5.tgz", diff --git a/client/package.json b/client/package.json index 5beed67496..966c961cd1 100644 --- a/client/package.json +++ b/client/package.json @@ -60,7 +60,6 @@ "react-redux": "^5.0.7", "react-reflex": "^3.0.16", "react-responsive": "^6.1.1", - "react-scroll": "^1.7.14", "react-spinkit": "^3.0.0", "react-stripe-elements": "^2.0.3", "react-tooltip": "^3.10.0", diff --git a/client/src/components/Map/index.js b/client/src/components/Map/index.js index 3c0a5c56cf..be17e71271 100644 --- a/client/src/components/Map/index.js +++ b/client/src/components/Map/index.js @@ -5,7 +5,6 @@ import { bindActionCreators } from 'redux'; import PropTypes from 'prop-types'; import uniq from 'lodash/uniq'; import { createSelector } from 'reselect'; -import { scroller } from 'react-scroll'; import SuperBlock from './components/SuperBlock'; import Spacer from '../helpers/Spacer'; @@ -57,21 +56,9 @@ function mapDispatchToProps(dispatch) { export class Map extends Component { constructor(props) { super(props); - this.state = { idToScrollto: null }; this.initializeExpandedState(); } - componentDidMount() { - if (this.state.idToScrollto) { - window.scrollTo(0, 0); - scroller.scrollTo(this.state.idToScrollto, { - duration: 1500, - smooth: 'easeInOutQuint', - offset: -35 - }); - } - } - // As this happens in the constructor, it's necessary to manipulate state // directly. initializeExpandedState() { @@ -89,16 +76,12 @@ export class Map extends Component { // find the challenge that has the same superblock with hash if (hash) { node = nodes.find(node => dasherize(node.superBlock) === hash); - // eslint-disable-next-line react/no-direct-mutation-state - if (node) this.state = { idToScrollto: dasherize(node.superBlock) }; } // if there is no hash or the hash did not match any challenge superblock // and there was a currentChallengeId if (!node && currentChallengeId) { node = nodes.find(node => node.id === currentChallengeId); - // eslint-disable-next-line react/no-direct-mutation-state - if (node) this.state = { idToScrollto: dasherize(node.title) }; } if (!node) node = nodes[0];