From 74ed60a3fb63decdef60e823748090302a072bd7 Mon Sep 17 00:00:00 2001 From: Andrew P Maney Date: Thu, 19 Mar 2020 02:38:31 -0700 Subject: [PATCH] Tasks: hides Sidebar amount if value 0 Tasks: makes amount conditional more concise --- src/components/Tasks/Sidebar.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Tasks/Sidebar.tsx b/src/components/Tasks/Sidebar.tsx index e9b9bab..60c117c 100644 --- a/src/components/Tasks/Sidebar.tsx +++ b/src/components/Tasks/Sidebar.tsx @@ -16,7 +16,7 @@ interface ListItemPropsType { name: string | null; icon?: React.ReactElement; primaryText: string; - amount?: number; + amount: number; } function SidebarListItem(props: ListItemPropsType) { @@ -34,7 +34,7 @@ function SidebarListItem(props: ListItemPropsType) { onClick={handleClick} selected={name === filterBy} leftIcon={icon} - rightIcon={{amount}} + rightIcon={{(amount > 0) && amount}} primaryText={primaryText} /> );