From 609d4e718228b720d2de9e7854fb431e4e87afeb Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 18 Nov 2026 20:17:06 +0000 Subject: [PATCH] cleanup `renderBrewCollection()` --- .../pages/basePages/listPage/listPage.jsx | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/client/homebrew/pages/basePages/listPage/listPage.jsx b/client/homebrew/pages/basePages/listPage/listPage.jsx index dd4c4a06f..7ea0699bf 100644 --- a/client/homebrew/pages/basePages/listPage/listPage.jsx +++ b/client/homebrew/pages/basePages/listPage/listPage.jsx @@ -233,28 +233,21 @@ const ListPage = ({ brewCollection = [{ title: '', class: '', brews: [] }], navI }); }; - const renderBrewCollection = (brewCollection)=>{ - if(brewCollection.length === 0) - return ( -
-

No Brews

-
- ); - return _.map(brewCollection, (brewGroup, idx)=>{ - const sortedBrewGroup = sortedBrewCollection[idx]; + const renderBrewCollection = ()=>{ + if(sortedBrewCollection.length === 0) + return

No Brews

; + + return _.map(sortedBrewCollection, (brewGroup, idx)=>{ const visible = groupVisibility[brewGroup.class]; return (<>

{ - toggleBrewCollectionState(brewGroup.class); - }}> + onClick={()=>toggleBrewCollectionState(brewGroup.class)}> {brewGroup.title || 'No Title'}

- - {visible ? renderBrews(sortedBrewGroup.brews) : <>} + {visible ? renderBrews(brewGroup.brews) : <>}
); }); @@ -318,7 +311,6 @@ const ListPage = ({ brewCollection = [{ title: '', class: '', brews: [] }], navI {renderTagsOptions()} ); - }; return ( @@ -328,7 +320,7 @@ const ListPage = ({ brewCollection = [{ title: '', class: '', brews: [] }], navI {renderNav()}
-
{renderBrewCollection(brewCollection)}
+
{renderBrewCollection()}
);