Fix minor bugs
This commit is contained in:
parent
544d13754a
commit
249647cafa
2 changed files with 27 additions and 21 deletions
|
@ -14,18 +14,23 @@ export interface SearchBarProps extends SearchPageProps, TabPageProps {
|
||||||
searchPlaceholder: string;
|
searchPlaceholder: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const useStyles = makeStyles((theme: Theme) => ({
|
const useStyles = makeStyles(
|
||||||
tabAction: {
|
(theme: Theme) => ({
|
||||||
display: "inline-block"
|
tabAction: {
|
||||||
},
|
display: "inline-block"
|
||||||
tabActionContainer: {
|
},
|
||||||
borderBottom: "1px solid #e8e8e8",
|
tabActionContainer: {
|
||||||
display: "flex",
|
borderBottom: "1px solid #e8e8e8",
|
||||||
justifyContent: "flex-end",
|
display: "flex",
|
||||||
marginTop: theme.spacing.unit,
|
justifyContent: "flex-end",
|
||||||
padding: `0 ${theme.spacing.unit * 3}px ${theme.spacing.unit}px`
|
marginTop: theme.spacing.unit,
|
||||||
|
padding: `0 ${theme.spacing.unit * 3}px ${theme.spacing.unit}px`
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
name: "SearchBar"
|
||||||
}
|
}
|
||||||
}));
|
);
|
||||||
|
|
||||||
const SearchBar: React.FC<SearchBarProps> = props => {
|
const SearchBar: React.FC<SearchBarProps> = props => {
|
||||||
const {
|
const {
|
||||||
|
@ -88,10 +93,10 @@ const SearchBar: React.FC<SearchBarProps> = props => {
|
||||||
search={search}
|
search={search}
|
||||||
onSearchChange={handleSearchChange}
|
onSearchChange={handleSearchChange}
|
||||||
/>
|
/>
|
||||||
<div className={classes.tabActionContainer}>
|
{!!search || (tabs && tabs.length > 0) ? (
|
||||||
<div className={classes.tabAction}>
|
<div className={classes.tabActionContainer}>
|
||||||
{search || (tabs && tabs.length) > 0 ? (
|
<div className={classes.tabAction}>
|
||||||
isCustom ? (
|
{isCustom ? (
|
||||||
<Link onClick={onTabSave}>
|
<Link onClick={onTabSave}>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
defaultMessage="Save Custom Search"
|
defaultMessage="Save Custom Search"
|
||||||
|
@ -105,12 +110,12 @@ const SearchBar: React.FC<SearchBarProps> = props => {
|
||||||
description="button"
|
description="button"
|
||||||
/>
|
/>
|
||||||
</Link>
|
</Link>
|
||||||
)
|
)}
|
||||||
) : (
|
</div>
|
||||||
<Hr />
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
) : (
|
||||||
|
<Hr />
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
|
@ -118,5 +123,6 @@ const SearchBar: React.FC<SearchBarProps> = props => {
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
SearchBar.displayName = "SearchBar";
|
SearchBar.displayName = "SearchBar";
|
||||||
export default SearchBar;
|
export default SearchBar;
|
||||||
|
|
|
@ -110,7 +110,7 @@ export const FilterChips: React.FC<FilterChipProps> = ({
|
||||||
onSearchChange={onSearchChange}
|
onSearchChange={onSearchChange}
|
||||||
onFilterAdd={onFilterAdd}
|
onFilterAdd={onFilterAdd}
|
||||||
/>
|
/>
|
||||||
{search || (filtersList && filtersList.length) ? (
|
{search || (filtersList && filtersList.length > 0) ? (
|
||||||
<div className={classes.filterContainer}>
|
<div className={classes.filterContainer}>
|
||||||
<div className={classes.filterChipContainer}>
|
<div className={classes.filterChipContainer}>
|
||||||
{filtersList.map(filter => (
|
{filtersList.map(filter => (
|
||||||
|
|
Loading…
Reference in a new issue