Skip to content

Commit 7ab870f

Browse files
committed
feat: only show favorite tab if there are patterns in favorites
1 parent ab8e4f5 commit 7ab870f

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

src/blocks/plugins/patterns-library/library.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,15 @@ const Library = ({
205205
) }
206206

207207
<div className="o-library__modal__sidebar">
208-
<Button
209-
icon="heart"
210-
isPressed={ 'favorites' === selectedCategory }
211-
onClick={ () => setSelectedCategory( 'favorites' ) }
212-
>
213-
{ __( 'My Favorites', 'otter-blocks' ) }
214-
</Button>
208+
{ getFavorites?.length > 0 && (
209+
<Button
210+
icon="heart"
211+
isPressed={ 'favorites' === selectedCategory }
212+
onClick={ () => setSelectedCategory( 'favorites' ) }
213+
>
214+
{ __( 'My Favorites', 'otter-blocks' ) }
215+
</Button>
216+
)}
215217

216218
{( tcCategories.length < 1 && Boolean( window?.themeisleGutenberg?.hasPatternSources ) ) && (
217219
<Button

0 commit comments

Comments
 (0)