Skip to content

Commit e2f2e4c

Browse files
Fix: hide empty snippet description paragraph
1 parent 6c785d1 commit e2f2e4c

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/js/components/ManageMenu/CommunityCloud/SearchResults.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,13 @@ const CloudSnippetDetails: React.FC<CloudSnippetDetailsProps> = ({ snippet, setI
5656
: null}
5757
</div>
5858

59-
<p className="cloud-snippet-description">
60-
{snippet.description.length > MAX_DESCRIPTION_LENGTH
61-
? `${snippet.description.slice(0, MAX_DESCRIPTION_LENGTH)}…`
62-
: snippet.description}
63-
</p>
59+
{snippet.description && (
60+
<p className="cloud-snippet-description">
61+
{snippet.description.length > MAX_DESCRIPTION_LENGTH
62+
? `${snippet.description.slice(0, MAX_DESCRIPTION_LENGTH)}…`
63+
: snippet.description}
64+
</p>
65+
)}
6466

6567
<p className="cloud-snippet-author">
6668
{_x('by ', 'snippet author', 'code-snippets')}

0 commit comments

Comments
 (0)