From ea6013a93b97f8f24820928ec55c4b96d240517f Mon Sep 17 00:00:00 2001 From: santisiri Date: Wed, 29 Jul 2020 17:31:31 +0200 Subject: [PATCH] new sidebar menu done --- imports/ui/components/Menu/Menu.jsx | 47 ++++++++++++++++------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/imports/ui/components/Menu/Menu.jsx b/imports/ui/components/Menu/Menu.jsx index 37dacb181..1ce0f0385 100644 --- a/imports/ui/components/Menu/Menu.jsx +++ b/imports/ui/components/Menu/Menu.jsx @@ -130,17 +130,18 @@ const _getHeadline = (headline, account) => { const MenuQuery = ({ account }) => { const atHome = (Router.current().url.replace(window.location.origin, '') === '/'); const hideEmpty = !atHome; + const defaultLabels = ['all', 'in-queue', 'voting-now', 'grace-period', 'ready-to-process', 'guild-kicks', 'rejected', 'approved']; const defaultMenu = (
- - - - - - - - + + + + + + + +
); @@ -149,7 +150,17 @@ const MenuQuery = ({ account }) => { if (loading) { return ( -
+
+
+
+
+ {_getHeadline('proposals', account)} +
+ {
} +
+
+
+ ); } if (error) return `Error! ${error}`; @@ -165,18 +176,12 @@ const MenuQuery = ({ account }) => { ); }); - const menuList = ( -
- - - - - - - - -
- ); + let i = 0; + for (const defaultItem of defaultMenu.props.children) { + defaultItem.props.score = (atHome) ? null : _getProposalCount(data.members, defaultLabels[i]); + i += 1; + } + const menuList = defaultMenu; return (