Tasks: hides Sidebar amount if value 0

Tasks: makes amount conditional more concise
master
Andrew P Maney 5 years ago committed by Tom Hacohen
parent e008bc19e8
commit 74ed60a3fb

@ -16,7 +16,7 @@ interface ListItemPropsType {
name: string | null; name: string | null;
icon?: React.ReactElement; icon?: React.ReactElement;
primaryText: string; primaryText: string;
amount?: number; amount: number;
} }
function SidebarListItem(props: ListItemPropsType) { function SidebarListItem(props: ListItemPropsType) {
@ -34,7 +34,7 @@ function SidebarListItem(props: ListItemPropsType) {
onClick={handleClick} onClick={handleClick}
selected={name === filterBy} selected={name === filterBy}
leftIcon={icon} leftIcon={icon}
rightIcon={<span style={{ width: '100%', textAlign: 'right' }}>{amount}</span>} rightIcon={<span style={{ width: '100%', textAlign: 'right' }}>{(amount > 0) && amount}</span>}
primaryText={primaryText} primaryText={primaryText}
/> />
); );

Loading…
Cancel
Save