From f08f9b27d8e8f943d6a201de0093ab58255d0ca8 Mon Sep 17 00:00:00 2001 From: Qstick Date: Mon, 29 Jun 2020 21:26:51 -0400 Subject: [PATCH] Fixed: Toolbar button collapsing includes separator --- frontend/src/Artist/Index/ArtistIndex.js | 6 +----- .../Components/Page/Toolbar/PageToolbarSection.css | 2 +- .../src/Components/Page/Toolbar/PageToolbarSection.js | 11 +++++------ 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/frontend/src/Artist/Index/ArtistIndex.js b/frontend/src/Artist/Index/ArtistIndex.js index e250d61f5..dc61fb72b 100644 --- a/frontend/src/Artist/Index/ArtistIndex.js +++ b/frontend/src/Artist/Index/ArtistIndex.js @@ -282,11 +282,7 @@ class ArtistIndex extends Component { null } - { - (view === 'posters' || view === 'banners' || view === 'overview') && - - - } + { - const name = child.type.name; - - if (name === SEPARATOR_NAME) { + if (Object.keys(child.props).length === 0) { separatorCount++; } else { buttonCount++; @@ -68,12 +65,14 @@ function calculateOverflowItems(children, isMeasured, width, collapseButtons) { } validChildren.forEach((child, index) => { + const isSeparator = Object.keys(child.props).length === 0; + if (actualButtons < maxButtons) { - if (child.type.name !== SEPARATOR_NAME) { + if (!isSeparator) { buttons.push(child); actualButtons++; } - } else if (child.type.name !== SEPARATOR_NAME) { + } else if (!isSeparator) { overflowItems.push(child.props); } });