From 7eb3c04ef85fa0311bdf30b24df2aba102757878 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 19 Mar 2019 20:45:24 +0100 Subject: rebuild site --- scraper/client/search/panicButton.component.js | 49 -------------------------- 1 file changed, 49 deletions(-) delete mode 100644 scraper/client/search/panicButton.component.js (limited to 'scraper/client/search/panicButton.component.js') diff --git a/scraper/client/search/panicButton.component.js b/scraper/client/search/panicButton.component.js deleted file mode 100644 index a12c817b..00000000 --- a/scraper/client/search/panicButton.component.js +++ /dev/null @@ -1,49 +0,0 @@ -import React, { Component } from 'react' -import { withRouter } from 'react-router-dom' -import { bindActionCreators } from 'redux' -import { connect } from 'react-redux' - -import * as actions from './search.actions' - -class PanicButton extends Component { - constructor() { - super() - this.keydown = this.keydown.bind(this) - } - - componentDidMount() { - document.addEventListener('keydown', this.keydown) - } - - componentWillUnmount() { - document.removeEventListener('keydown', this.keydown) - } - - keydown(e) { - if (e.keyCode === 27) { - this.panic() - } - } - - panic() { - this.props.actions.panic() - this.props.history.push('/search/') - } - - render() { - return ( - - ) - } -} - -const mapStateToProps = state => ({ -}) - -const mapDispatchToProps = dispatch => ({ - actions: bindActionCreators({ panic: actions.panic }, dispatch) -}) - -export default withRouter(connect(mapStateToProps, mapDispatchToProps)(PanicButton)) -- cgit v1.2.3-70-g09d2