Skip to content

Commit

Permalink
fix(ui): texthighlight block empty text removes element
Browse files Browse the repository at this point in the history
  • Loading branch information
RaneHyv committed Mar 7, 2024
1 parent e546cc5 commit 6d32fcb
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions frontend/src/components/blocks/TextHighlight/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ const installTextHighlightBlock = (config) => {
title: 'Text Highlight',
icon: alertSVG,
group: 'common',
view: (props) => (
<div className="block full-width text-highlight">
<Container>
<TextBlockView {...props} />
</Container>
</div>
),
view: (props) => {
const text = props.data.plaintext.trim() || '';
return text ? (
<div className="block text-highlight">
<Container>
<TextBlockView {...props} />
</Container>
</div>
) : (
''
);
},
edit: (props) => (
<div className="block edit-mode text-highlight">
<TextBlockEdit {...props} />
Expand Down

0 comments on commit 6d32fcb

Please sign in to comment.