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:
parent
98a7b77760
commit
d952c38a7f
1 changed files with 5 additions and 0 deletions
|
@ -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());
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue