From 111191ed0207bb3840db6787687998301b7880a2 Mon Sep 17 00:00:00 2001 From: Wisani Shilumani Date: Fri, 13 Jul 2018 13:39:01 +0200 Subject: [PATCH] Fix click search --- components/browseArchives/index.js | 4 ++-- components/searchResults/index.js | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/components/browseArchives/index.js b/components/browseArchives/index.js index 94e6697..879f480 100644 --- a/components/browseArchives/index.js +++ b/components/browseArchives/index.js @@ -17,7 +17,7 @@ class BrowseArchives extends React.Component { this.state = { term: '', debounceTerm: '', - searchResults: [], + searchResults: [null], isSingleInterviewModalOpen: false, isInterviewsListModalOpen: false, activeSingleInterviewId: 1, @@ -39,7 +39,7 @@ class BrowseArchives extends React.Component { this.setState({ term: event.target.value, isSearchActive: true, - searchResults: [], + searchResults: [null], }); if (event.target.value.length === 0) { diff --git a/components/searchResults/index.js b/components/searchResults/index.js index 68f6460..b93939c 100644 --- a/components/searchResults/index.js +++ b/components/searchResults/index.js @@ -4,8 +4,10 @@ import './style.scss'; import Parser from 'html-react-parser'; const SearchResults = (props) => { - if (!props.data || props.data.length < 1) { + if (!props.data || props.data[0] === null) { return
Loading...
; + } else if (props.data.length < 1) { + return
No results found
; } // sort array alphabetically