Skip to content

Commit

Permalink
707, 424: Fixed alignment problem when some menu items have a leading…
Browse files Browse the repository at this point in the history
… icon and others don't (#786)
  • Loading branch information
tombogle authored Mar 1, 2024
2 parents 4d3968b + 3d8b977 commit 472c355
Show file tree
Hide file tree
Showing 5 changed files with 281 additions and 277 deletions.
274 changes: 137 additions & 137 deletions lib/platform-bible-react/dist/index.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/platform-bible-react/dist/index.cjs.map

Large diffs are not rendered by default.

276 changes: 139 additions & 137 deletions lib/platform-bible-react/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/platform-bible-react/dist/index.js.map

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ export default function GroupedMenuItemList(menuProps: GroupedMenuItemListProps)
// No divider after last item in final group.
if (itemArray.length > 0) itemArray[itemArray.length - 1].isLastItemInGroup = false;

const allowSpaceForLeadingIcons = itemArray.some((i) => 'iconPathBefore' in i);
const allowSpaceForLeadingIcons = itemArray.some(
(i) => 'iconPathBefore' in i.item && i.item.iconPathBefore,
);

return { items: itemArray, allowForLeadingIcons: allowSpaceForLeadingIcons };
}, [includedGroups, menuDefinition]);
Expand Down

0 comments on commit 472c355

Please sign in to comment.