Skip to content

Commit

Permalink
Update FacetedSearch.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
ksuess committed Jan 4, 2021
1 parent a937ec1 commit c48f44a
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/components/Views/FacetedSearch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ import { OverridableContext } from 'react-overridable';
import { Link } from 'react-router-dom';
import _truncate from 'lodash/truncate';
import {
Button,
Checkbox,
Container,
Dropdown,
Grid,
Header,
Icon,
Item,
Label,
Expand Down Expand Up @@ -252,10 +254,37 @@ const customBucketAggregationValuesElement = (props) => {
);
};

const customEmpytResultsElement = (props) => {
const { queryString, resetQuery } = props;
return (
<Segment placeholder textAlign="center">
<Header icon>
<Icon name="search" />
Keine Resultate gefunden.
</Header>
{/* {queryString && <em>Current search "{queryString}"</em>}
<br /> */}
<Button
primary
onClick={() => {
resetQuery();
// todo click cross of search input field
document
.querySelector('nav.navigation .ui.basic.button.cancel')
.click();
}}
>
Suche zurücksetzen
</Button>
</Segment>
);
};

let overriddenComponents = {
'ResultsList.item.elasticsearch': CustomResultsListItem,
'Count.element': myCountElement,
'ActiveFilters.element': myActiveFiltersElement,
'EmptyResults.element': customEmpytResultsElement,
};

if (configSearchFilterLayout === 'dropdown') {
Expand Down

0 comments on commit c48f44a

Please sign in to comment.