0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Removed empty tag section in search

- if no tags match the search, removes the section
This commit is contained in:
Rishabh 2022-07-05 16:44:02 +02:00
parent 98a7b77760
commit d952c38a7f

View file

@ -160,6 +160,10 @@ function TagListItem({title}) {
}
function TagResults({tags}) {
if (!tags?.length) {
return null;
}
const TagItems = tags.map((d) => {
return (
<TagListItem
@ -253,6 +257,7 @@ function AuthorResults({authors}) {
function SearchResultBox() {
const {searchValue = ''} = useContext(AppContext);
const filteredTags = tagsData.filter((d) => {
return d.title?.toLowerCase().includes(searchValue?.toLowerCase());
});