feat: Version control commit, View on GitHub (#17)

* feat: Version control commit, View on GitHub

* fix: MenuDialog allow undefined menu item

This makes it a lot easier to create conditional menu items
This commit is contained in:
Eric Tuvesson
2024-05-14 14:00:43 +02:00
committed by GitHub
parent 13c92779b2
commit 4e09a70a24
4 changed files with 35 additions and 21 deletions

View File

@@ -72,7 +72,7 @@ export function MenuDialog({
hasArrow
>
<div className={classNames(css['Root'], css[width])} style={{ maxHeight: UNSAFE_maxHeight }}>
{items.map((item, i) => {
{items.filter(Boolean).map((item, i) => {
if (item === 'divider') return <div className={css['Divider']} key={i} />;
if (item?.isHidden) return null;