From 251eee4c964a9093bd727a2ea5d42274804af173 Mon Sep 17 00:00:00 2001 From: Lachlan Kermode Date: Wed, 23 Sep 2020 18:41:01 +0200 Subject: [PATCH] rm unused search --- src/components/Toolbar/Layout.js | 17 -------- src/components/Toolbar/Search.js | 71 -------------------------------- 2 files changed, 88 deletions(-) delete mode 100644 src/components/Toolbar/Search.js diff --git a/src/components/Toolbar/Layout.js b/src/components/Toolbar/Layout.js index cceab2a..ca0d1ae 100644 --- a/src/components/Toolbar/Layout.js +++ b/src/components/Toolbar/Layout.js @@ -31,23 +31,6 @@ class Toolbar extends React.Component { ) } - renderSearch () { - if (this.props.features.USE_SEARCH) { - return ( - - - - ) - } - } - goToNarrative (narrative) { this.selectTab(-1) // set all unselected within this component this.props.methods.onSelectNarrative(narrative) diff --git a/src/components/Toolbar/Search.js b/src/components/Toolbar/Search.js deleted file mode 100644 index 2004e15..0000000 --- a/src/components/Toolbar/Search.js +++ /dev/null @@ -1,71 +0,0 @@ -/* global fetch */ -import React from 'react' -import copy from '../../common/data/copy.json' -import SelectFilter from './SelectFilter' - -export default class Search extends React.Component { - constructor (props) { - super(props) - this.state = { - searchValue: undefined, - searchResults: [] - } - - this.handleSearchChange = this.handleSearchChange.bind(this) - this.handleSearchSubmit = this.handleSearchSubmit.bind(this) - } - - handleSearchSubmit (e) { - e.preventDefault() - fetch(`api/search/${this.state.searchValue}`) - .then(response => response.json()) - .then(json => { - this.setState({ - searchResults: json.filters - }) - }) - } - - handleSearchChange (event) { - this.setState({ searchValue: event.target.value }) - } - - renderSearchResults () { - return ( - this.state.searchResults.map(filter => { - return ( - - ) - }) - ) - } - - render () { - return ( -
-

{copy[this.props.language].toolbar.panels.search.title}

-
- -
-
    - {this.renderSearchResults()} -
-
- ) - } -}