Skip to content

Commit

Permalink
Build "Show More" menu items only if there are enough
Browse files Browse the repository at this point in the history
  • Loading branch information
dtrucs committed Oct 29, 2024
1 parent 1a33f08 commit dd3acb4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frontend/src/components/InlineMenu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ export const Menu: React.FC<MenuProps> = ({
}) => {
const intl = useIntl();
const items = useMemo(() => {
if (menuItems.some(({ children = [] }) => children.length)) {
if (
menuItems.length < primaryItemsNumber ||
menuItems.some(({ children = [] }) => children.length)
) {
return menuItems;
}
// If there are no children, we use "primaryItemsNumber" to split menu with "See More" button
Expand Down

0 comments on commit dd3acb4

Please sign in to comment.