diff --git a/src/modules/CategorySelector/CategorySelector.jsx b/src/modules/CategorySelector/CategorySelector.jsx index 02363d9..f3b503a 100644 --- a/src/modules/CategorySelector/CategorySelector.jsx +++ b/src/modules/CategorySelector/CategorySelector.jsx @@ -8,14 +8,6 @@ import dropdownArrows from '../../common/assets/images/dropdown-arrows.svg' import styles from './CategorySelector.module.scss' class CategorySelector extends React.Component { - static onClickHighestRanked() { - window.location.hash = 'highest-ranked' - } - - static onClickRecentlyAdded() { - window.location.hash = 'recently-added' - } - constructor(props) { super(props) this.state = { open: false } @@ -23,6 +15,8 @@ class CategorySelector extends React.Component { this.updateCategory = this.updateCategory.bind(this) this.container = React.createRef() this.onClickSubmit = this.onClickSubmit.bind(this) + this.onClickHighestRanked = this.onClickHighestRanked.bind(this) + this.onClickRecentlyAdded = this.onClickRecentlyAdded.bind(this) } componentDidMount() { @@ -49,6 +43,20 @@ class CategorySelector extends React.Component { this.setState({ open: false }) } + onClickHighestRanked(e) { + const { onClickCloseDesktopMenu } = this.props + onClickCloseDesktopMenu() + e.stopPropagation() + window.location.hash = 'highest-ranked' + } + + onClickRecentlyAdded(e) { + const { onClickCloseDesktopMenu } = this.props + onClickCloseDesktopMenu() + e.stopPropagation() + window.location.hash = 'recently-added' + } + updateCategory(event) { const { select } = this.props select(event.target.value) @@ -106,7 +114,7 @@ class CategorySelector extends React.Component {