From 249647cafa4404c6b978f9041b92fd59c317c7a2 Mon Sep 17 00:00:00 2001 From: dominik-zeglen Date: Tue, 10 Sep 2019 17:32:38 +0200 Subject: [PATCH] Fix minor bugs --- src/components/SearchBar/SearchBar.tsx | 46 ++++++++++++---------- src/components/TableFilter/FilterChips.tsx | 2 +- 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/src/components/SearchBar/SearchBar.tsx b/src/components/SearchBar/SearchBar.tsx index 15f13cede..7bb4b2d67 100644 --- a/src/components/SearchBar/SearchBar.tsx +++ b/src/components/SearchBar/SearchBar.tsx @@ -14,18 +14,23 @@ export interface SearchBarProps extends SearchPageProps, TabPageProps { searchPlaceholder: string; } -const useStyles = makeStyles((theme: Theme) => ({ - tabAction: { - display: "inline-block" - }, - tabActionContainer: { - borderBottom: "1px solid #e8e8e8", - display: "flex", - justifyContent: "flex-end", - marginTop: theme.spacing.unit, - padding: `0 ${theme.spacing.unit * 3}px ${theme.spacing.unit}px` +const useStyles = makeStyles( + (theme: Theme) => ({ + tabAction: { + display: "inline-block" + }, + tabActionContainer: { + borderBottom: "1px solid #e8e8e8", + display: "flex", + justifyContent: "flex-end", + marginTop: theme.spacing.unit, + padding: `0 ${theme.spacing.unit * 3}px ${theme.spacing.unit}px` + } + }), + { + name: "SearchBar" } -})); +); const SearchBar: React.FC = props => { const { @@ -88,10 +93,10 @@ const SearchBar: React.FC = props => { search={search} onSearchChange={handleSearchChange} /> -
-
- {search || (tabs && tabs.length) > 0 ? ( - isCustom ? ( + {!!search || (tabs && tabs.length > 0) ? ( +
+
+ {isCustom ? ( = props => { description="button" /> - ) - ) : ( -
- )} + )} +
-
+ ) : ( +
+ )} ); }} @@ -118,5 +123,6 @@ const SearchBar: React.FC = props => { ); }; + SearchBar.displayName = "SearchBar"; export default SearchBar; diff --git a/src/components/TableFilter/FilterChips.tsx b/src/components/TableFilter/FilterChips.tsx index 770684cce..4f2b6fd9c 100644 --- a/src/components/TableFilter/FilterChips.tsx +++ b/src/components/TableFilter/FilterChips.tsx @@ -110,7 +110,7 @@ export const FilterChips: React.FC = ({ onSearchChange={onSearchChange} onFilterAdd={onFilterAdd} /> - {search || (filtersList && filtersList.length) ? ( + {search || (filtersList && filtersList.length > 0) ? (
{filtersList.map(filter => (