Skip to content

Commit

Permalink
Merge pull request #567 from prezly/feature/care-5943-remove-the-sett…
Browse files Browse the repository at this point in the history
…ing-panel-when-there-are-no-settings

[CARE-5943] Hide settings menu if there's only one option without a fallback support
  • Loading branch information
kudlajz authored Aug 9, 2024
2 parents 272101b + 60473ed commit 8ae86f4
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ export function VariableMenu({ container, element, onClose, variables }: Props)
removeVariable(editor);
}

if (options.length < 2 && !option?.withFallback) {
return null;
}

return (
<Menu
popperOptions={{ ...popperOptions, modifiers: { arrow: { padding: 0 } } }}
Expand Down

0 comments on commit 8ae86f4

Please sign in to comment.