mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Removed empty tag section in search
- if no tags match the search, removes the section
This commit is contained in:
parent
98a7b77760
commit
d952c38a7f
1 changed files with 5 additions and 0 deletions
|
@ -160,6 +160,10 @@ function TagListItem({title}) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function TagResults({tags}) {
|
function TagResults({tags}) {
|
||||||
|
if (!tags?.length) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const TagItems = tags.map((d) => {
|
const TagItems = tags.map((d) => {
|
||||||
return (
|
return (
|
||||||
<TagListItem
|
<TagListItem
|
||||||
|
@ -253,6 +257,7 @@ function AuthorResults({authors}) {
|
||||||
|
|
||||||
function SearchResultBox() {
|
function SearchResultBox() {
|
||||||
const {searchValue = ''} = useContext(AppContext);
|
const {searchValue = ''} = useContext(AppContext);
|
||||||
|
|
||||||
const filteredTags = tagsData.filter((d) => {
|
const filteredTags = tagsData.filter((d) => {
|
||||||
return d.title?.toLowerCase().includes(searchValue?.toLowerCase());
|
return d.title?.toLowerCase().includes(searchValue?.toLowerCase());
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue